Skip to content

Commit 69b2082

Browse files
committed
[io grant] Document IO::Path.chdir
- Include deprecation notice for 6.d language
1 parent 4507485 commit 69b2082

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

doc/Type/IO/Path.pod6

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,23 @@ contents, and appending data to the end of the file.
467467
468468
=item C<:$createonly>L«C<fail>|/routine/fail» if the file already exists.
469469
470-
=head2 routine chdir
471-
472-
multi method chdir(IO::Path:U: $path, :$test = 'r' --> IO::Path)
473-
multi method chdir(IO::Path:D: Str() $path is copy, :$test = 'r' --> IO::Path)
470+
=head2 method chdir
471+
472+
multi method chdir(IO::Path:D: Str() $path, :$d = True, :$r, :$w, :$x)
473+
474+
B<DEPRECATION NOTICE:> this method will be deprecated in C<6.d> language. Do
475+
not use it for new code. Instead, create a new path or use
476+
L«C<concat-with>|/routine/concat-with» method. For altering current working
477+
directory see L«C<&chdir>|/routine/chdir» and L«C<&*chdir>|/routine/&*chdir»
478+
subroutines.
479+
480+
Contrary to the name, the C<.chdir> method does not change any directories,
481+
but mereley concatenates the given C<$path> to the invocant and returns the
482+
resultant C<IO::Path>. Optional file tests can be performed by providing
483+
C<:d>, C<:r>, C<:w>, or C<:x> L«C<Bool>|/type/Bool» named arguments; when
484+
set to C<True>, they'll perform L«C<.d>|/routine/d», L«C<.r>|/routine/r»,
485+
L«C<.w>|/routine/w», and L«C<.x>|/routine/x» tests respectively. By default,
486+
only C<:d> is set to C<True>.
474487
475488
=head2 routine mkdir
476489

0 commit comments

Comments
 (0)