Moving (Renaming) Files or Directories: The Move Factory

SCons User Guide 0.98.0
Prev | Chapter 12. Platform-Independent File System Manipulation | Next

# 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",
                  [
                    Copy("tempfile", "$SOURCE"),
                    "modify tempfile",
                    Move("$TARGET", "tempfile"),
                  ])

Which would execute as:

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

Prev | Home | Next
Deleting Files or Directories: The `Delete` Factory | Up | Updating the Modification Time of a File: The `Touch` Factory