Skip to content

Commit

Permalink
[io grant] Document &chdir
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Apr 3, 2017
1 parent d050d4b commit 1d0e433
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions doc/Type/IO.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@ L<IO::Path|/type/IO::Path>. This is the exception from the rule.
=head1 Routines
=head2 sub chdir
Defined as:
sub chdir(IO() $path, :$d = True, :$r, :$w, :$x --> IO::Path:D)
Changes value of C<$*CWD> variable to the provided C<$path>, optionally ensuring
the new path passes several file tests. B<NOTE:> that this routine does I<NOT>
alter the process's current directory (see L«C<&*chdir>|/routine/chdir»).
Returns L«C<IO::Path>|/type/IO::Path»
representing new C<$*CWD> on success. On failure, returns
L«C<Failure>|/type/Failure» and leaves C<$*CWD> untouched.
The C<$path> can be any any object with an IO method that returns an
L«C<IO::Path>|/type/IO::Path» object. The available file tests are:
=item C<:d> — check L«C<.d>|/routine/d» returns C<True>
=item C<:r> — check L«C<.r>|/routine/d» returns C<True>
=item C<:w> — check L«C<.w>|/routine/d» returns C<True>
=item C<:x> — check L«C<.x>|/routine/d» returns C<True>
By default, only C<:d> test is performed.
chdir '/tmp'; # change $*CWD to '/tmp' and check its .d is True
chdir :r, :w '/tmp'; # … check its .r and .w are True
chdir '/not-there'; # returns Failure
=head2 sub print
Print the given text on C<$*OUT> (standard output), e.g.:
Expand Down

0 comments on commit 1d0e433

Please sign in to comment.