Skip to content

Commit a5df488

Browse files
committed
Add indir/tmpdir/homedir to overview
1 parent d8869f8 commit a5df488

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

S16-io.pod

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Synopsis 16: I/O
1818

1919
Created: 12 Sep 2006
2020

21-
Last Modified: 23 Sep 2014
22-
Version: 25
21+
Last Modified: 5 Oct 2014
22+
Version: 26
2323

2424
Many of these functions will work as in Perl 5, except we're trying to rationalize everything into roles. For
2525
now you can assume most of the important functions will automatically
@@ -260,9 +260,21 @@ An overview:
260260
rmdir($dir) # remove a directory
261261

262262
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
266278

267279
copy($from,$to) # copy a file
268280
rename($from,$to) # rename (move) a file on same physical storage

0 commit comments

Comments
 (0)