@@ -18,8 +18,8 @@ Synopsis 16: I/O
18
18
19
19
Created: 12 Sep 2006
20
20
21
- Last Modified: 23 Sep 2014
22
- Version: 25
21
+ Last Modified: 5 Oct 2014
22
+ Version: 26
23
23
24
24
Many of these functions will work as in Perl 5, except we're trying to rationalize everything into roles. For
25
25
now you can assume most of the important functions will automatically
@@ -260,9 +260,21 @@ An overview:
260
260
rmdir($dir) # remove a directory
261
261
262
262
chdir($dir) # set $*CWD
263
- chdir($dir, my $*CWD) # set $*CWD for the current scope
264
- chdir($dir, my $*TMPDIR, :test<d r w x>) # set $*TMPDIR, also be +w and +x
265
- chdir($dir, my $*HOME) # set $*HOME for the current scope
263
+ temp $*CWD = chdir($dir) # set $*CWD for the current scope
264
+ chdir($dir, :test<r w x>) # set $*CWD, must also be +w and +x, default +r
265
+
266
+ indir($dir, { ... }) # execute code with temporary $*CWD
267
+ indir($dir, :test<r w x>, { # same, must be also +x, default +rw
268
+ ...
269
+ };
270
+
271
+ tmpdir($dir) # set $*TMPDIR
272
+ temp $*TMPDIR = tmpdir($dir) # set $*TMPDIR for the current scope
273
+ tmpdir($dir, :test<r>) # set $*TMPDIR, must be +r only, default +rwx
274
+
275
+ homedir($dir) # set $*HOME
276
+ temp $*HOME = homedir($dir) # set $*HOME for the current scope
277
+ homedir($dir, :test<r>) # set $*HOME, must be +r only, default +rwx
266
278
267
279
copy($from,$to) # copy a file
268
280
rename($from,$to) # rename (move) a file on same physical storage
0 commit comments