[Scons-users] Reading a file in an emitter

Dirk Bächle tshortik at gmx.de
Thu Mar 19 04:09:24 EDT 2015


Hello William,

On 18.03.2015 23:35, William Roberts wrote:
> I am attempting to read a source file passed in via source argument in my emmitter. However, I can't open the file, as the source
> file I am trying to read has not been symlinked into my variant directory.
>
> CWD: <root>out/vm
> IOError: [Errno 2] No such file or directory: 'src/miniat_java.i'
>
> Is their a proper way to read a source file while in the emitter and respect the virant dir?
>

in the latest source (current tip of our main development branch) there is the method

   Node.FS.Dir.rentry_exists_on_disk(name)

for exactly this purpose. It returns True if the given file exists locally, or in one of the repositories (remote locations). You 
can then create a proper Node for it, and use get_contents().

Best regards,

Dirk



More information about the Scons-users mailing list