Documentation for sub chdir

Documentation for sub chdir, assembled from the following types:

class IO::Path

From IO::Path

(IO::Path) routine chdir

sub chdir(Str() $path:$test = 'r' --> IO::Path)
multi method chdir(IO::Path:U: $path:$test = 'r' --> IO::Path)
multi method chdir(IO::Path:D: Str() $path is copy:$test = 'r' --> IO::Path)

Alter the process' notion of the current working directory (as found in $*CWD).

The subroutine and class method forms both change the directory relative to $*CWD if the supplied $path is not absolute. The object method form changes the directory relative to the path of the invocant if $path is not absolute. The optional named parameter test can specify a file test that should be applied to the target path if the operation is successful. The default test is that the directory is readable.

If the directory change is successful then the IO::Path representing the target directory is returned, otherwise it will fail with X::IO::Chdir.