Please note:The SCons wiki is now restored from the attack in March 2013. All old passwords have been invalidated. Please reset your password if you have an account. If you note missing pages, please report them to webmaster@scons.org. Also, new account creation is currently disabled due to an ongoing spam flood (2013/08/27).

The File() and Dir() functions return File and Dir Nodes (as python objects), respectively. Those objects have several user-visible attributes and methods that are often useful:

See also File().

   1 # Get the current build dir's path, relative to top.
   2 Dir('.').path
   3 # Current dir's absolute path
   4 Dir('.').abspath
   5 # Next line is always '.', because it is the top dir's path relative to itself.
   6 Dir('#.').path
   7 File('foo.c').srcnode().path   # source path of the given source file.
   8 
   9 # Builders also return File objects:
  10 foo = env.Program('foo.c')
  11 print "foo will be built in %s"%foo.path

Dir() (last edited 2010-07-27 13:00:11 by mail)