File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,29 @@ By default, only C<:d> test is performed.
39
39
chdir :r, :w '/tmp'; # … check its .r and .w are True
40
40
chdir '/not-there'; # returns Failure
41
41
42
+ = head2 sub &*chdir
43
+
44
+ Defined as:
45
+
46
+ sub &*chdir(IO() $path --> IO::Path:D)
47
+
48
+ Changes value of C < $*CWD > variable to the provided C < $path > and sets
49
+ the process's current directory to the value of
50
+ L « C < $path.absolute > |/routine/absolute» . B < NOTE: > that in most cases,
51
+ you want to use L « C < chdir > |/routine/chdir» routine instead.
52
+
53
+ Returns L « C < IO::Path > |/type/IO::Path»
54
+ representing new C < $*CWD > on success. On failure, returns
55
+ L « C < Failure > |/type/Failure» and leaves C < $*CWD > untouched.
56
+ The C < $path > can be any any object with an IO method that returns an
57
+ L « C < IO::Path > |/type/IO::Path» object.
58
+
59
+ Note that unlike regular L « C < chdir > |/routine/chdir» , there are no arguments
60
+ to specify which file tests to perform.
61
+
62
+ &*chdir('/tmp'); # change $*CWD and process's current directory to '/tmp'
63
+ &*chdir('/not-there'); # returns Failure
64
+
42
65
= head2 sub print
43
66
44
67
Print the given text on C < $*OUT > (standard output), e.g.:
You can’t perform that action at this time.
0 commit comments