12.3. Moving (Renaming) Files or Directories: The Move Factory

The Move factory allows you to rename a file or directory. For example, if we don't want to copy the temporary file, we could use:

Command(
    "file.out",
    "file.in",
    action=[
        Copy("tempfile", "$SOURCE"),
        "modify tempfile",
        Move("$TARGET", "tempfile"),
    ],
)
      

Which would execute as:

% scons -Q
Copy("tempfile", "file.in")
modify tempfile
Move("file.out", "tempfile")