Documentation for sub chmod

Documentation for sub chmod, assembled from the following types:

class IO::Path

From IO::Path

(IO::Path) routine chmod

sub    chmod($mode*@filenames --> List)
method chmod(IO::Path:D: $mode --> Bool)

Changes the POSIX permissions of a file (or in the subroutine form, any number of files) to $mode.

The subroutine form returns the names of the files for which setting the new mode was successful. The method form returns True on success, and otherwise fails with X::IO::Chmod.

The mode is expected as an integer following the standard numeric notation, and is best written as an octal number:

chmod 0o755"myfile1""myfile2"# make two files executable by the owner 
"myfile".IO.chmod(0o444);          # make a file read-only 
$*CWD.chmod(0o544);                # make the working directory read-only 

Make sure you don't accidentally pass the intended octal digits as a decimal number (or string containing a decimal number):

chmod '0444''myfile';            # BAD!!! (interpreted as mode 0o674)