[Scons-users] turning off directory creation?

Gary Oberbrunner garyo at oberbrunner.com
Tue Apr 30 09:08:58 EDT 2013


On Tue, Apr 30, 2013 at 9:03 AM, Robert Zeigler <robert.zeigler at gmail.com>wrote:


> I'm in the process of converting a make-based build to an scons one. One

> of the programs called during the build generates a set of targets in a

> particular directory structure. It creates this directory structure itself

> and, as currently written, won't work correctly if that directory structure

> already exists. However, it appears that scons automatically creates

> directories when a target is a directory path (see example at end of

> e-mail). I've worked around the problem for now by forcing the build to

> remove the destination directory, but that's an ugly hack. Long-term, the

> solution is to rework the underlying code to be more intelligent about

> handling existing directory structures, but there simply isn't time to do

> that right now. Is there a way to turn off scons's default "create

> non-existent target directory structure" behavior? I've googled this for

> the past day to no avail.

>

> Thanks!

>

> Robert

>

> SConstruct:

> Command(["foo/bar/baz.txt"],[],"echo noop")

>

> terminal:

>

> rm -rf foo/

> ls foo

> ls: cannot access foo: No such file or directory

> scons

> scons: Reading SConscript files …

> scons: done reading SConscript files.

> scons: Building targets …

> echo noop

> noop

> scons: done building targets.

>

> ls foo

> bar

>


You'd like an option that would make the above build just fail? Or are you
depending on the fact that the command doesn't actually create the target?

--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130430/cf7ee7cd/attachment.html>


More information about the Scons-users mailing list