Changing File or Directory Permissions: The Chmod Factory

SCons User Guide 0.98.0
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",
                  [
                    Copy("$TARGET", "$SOURCE"),
                    Chmod("$TARGET", 0755),
                  ])

Which executes:

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

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