Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.

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

See also Dir().

   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.
   9 # Builders also return File objects:
  10 foo = env.Program('foo.c')
  11 print "foo will be built in %s"%foo.path

File() (last edited 2008-07-06 00:07:57 by JohnFemiani)