Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add an example of using the ourput of IO.mode as input to IO.chmod
  • Loading branch information
MasterDuke17 committed Jun 9, 2016
1 parent d857a09 commit 5762144
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions doc/Type/IO/Path.pod
Expand Up @@ -516,8 +516,15 @@ Return an L<IntStr> object representing the POSIX permissions of a file. The
Str part of the result is the octal representation of the file permission, like
the form accepted by the chmod(1) utility.
say ~"path/to/file".IO.mode; # e.g. '0644'
say +"path/to/file".IO.mode; # e.g. 420, where sprintf('%04o', 420) eq '0644'
say ~"path/to/file".IO.mode; # e.g. '0644'
say +"path/to/file".IO.mode; # e.g. 420, where sprintf('%04o', 420) eq '0644'
The result of this can be used in the other methods that take a mode as an
argument.
"path/to/file1".IO.chmod("path/to/file2".IO.mode); # will change the
# permissions of file1
# to be the same as file2
=head1 Related roles and classes
Expand Down

0 comments on commit 5762144

Please sign in to comment.