12.6. Changing File or Directory Permissions: The `Chmod` Factory
Prev | Chapter 12. Platform-Independent File System Manipulation | Next

## 12.6. Changing File or Directory Permissions: The `Chmod` Factory

To change permissions on a file or directory, use the `Chmod` factory. The permission argument uses POSIX-style permission bits and should typically be expressed as an octal, not decimal, number:

    Command(
        "file.out",
        "file.in",
        action=[
            Copy("$TARGET", "$SOURCE"),
            Chmod("$TARGET", 0o755),
        ]
    )

Which executes:

    % scons -Q
    Copy("file.out", "file.in")
    Chmod("file.out", 0o755)

Prev | Up | Next
12.5. Creating a Directory: The `Mkdir` Factory | Home | 12.7. Executing an action immediately: the `Execute` Function