Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #565 from MasterDuke17/RT125489
Add documentation for the new IO.mode method
  • Loading branch information
lizmat committed Jun 18, 2016
2 parents fe7627b + 5762144 commit d838de5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Type/IO/Path.pod
Expand Up @@ -510,6 +510,22 @@ or more readably:
my $change_time = DateTime.new($chnge_instant);
say $change_time; # e.g. 2015-02-16T12:18:50Z
=head2 method mode
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'
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
See also the related role L<IO> and the related class L<IO::Handle>.
Expand Down
6 changes: 6 additions & 0 deletions doc/Type/IO/Special.pod
Expand Up @@ -111,4 +111,10 @@ The last accessed time always returns an undefined L<Instant>
The last changed time always returns an undefined L<Instant>
=head2 method mode
method mode(IO::Special:D:) returns Nil
The mode always returns L<Nil>
=end pod

0 comments on commit d838de5

Please sign in to comment.