12.3. Moving (Renaming) Files or Directories: The `Move` Factory
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",
        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")

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