set-file-permissions ( path n -- ) (original) (raw)

Vocabulary
io.files.info.unix

Inputs

path a pathname string
n an integer, interpreted as a string of bits

Outputs
None

Word description
Sets the file permissions for a given file with the supplied Unix permissions integer.

Examples
Using the traditional octal value:

USING: io.files.info.unix kernel ; "resource:LICENSE.txt" 0o755 set-file-permissions

Higher-level, setting named bits:

USING: io.files.info.unix kernel literals ; "resource:LICENSE.txt" flags{ USER-ALL GROUP-READ GROUP-EXECUTE OTHER-READ OTHER-EXECUTE } set-file-permissions

Definition