| SCons User Guide 1.1.0 | ||
|---|---|---|
| <<< Previous | Platform-Independent File System Manipulation | Next >>> |
If you need to create a directory, use the Mkdir factory. For example, if we need to process a file in a temporary directory in which the processing tool will create other files that we don't care about, you could use:
Command("file.out", "file.in",
[
Delete("tempdir"),
Mkdir("tempdir"),
Copy("tempdir/${SOURCE.file}", "$SOURCE"),
"process tempdir",
Move("$TARGET", "tempdir/output_file"),
Delete("tempdir"),
])
|
Which executes as:
% scons -Q
Delete("tempdir")
Mkdir("tempdir")
Copy("tempdir/file.in", "file.in")
process tempdir
Move("file.out", "tempdir/output_file")
scons: *** [file.out] No such file or directory
|
| <<< Previous | Home | Next >>> |
| Updating the Modification Time of a File: The Touch Factory | Up | Changing File or Directory Permissions: The Chmod Factory |