Skip to content

Commit

Permalink
Some minor movement, tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 23, 2014
1 parent eaffff8 commit 0ba7481
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions S16-io.pod
Expand Up @@ -72,6 +72,19 @@ syntax:
}
# stdout reverts to outer scope's definition, and closed the file

In short:

default handle
routine for sub form purpose
======= =========== =======
print $*OUT string-based writing
say $*OUT string-based writing
get $*ARGFILES read a line (Str)
lines $*ARGFILES read all lines (Str)
words $*ARGFILES read all words (Str)
read binary reading (Buf)
write binary writing (Buf)

=head2 Path Names and the .IO coercer

Path names are just strings (C<Str>). Methods that return path names, will
Expand Down Expand Up @@ -198,20 +211,16 @@ references to S32-setting-library/IO.pod. An overview:

=head3 Functions

$handle = open($path); # open a file, return IO::Handle

chdir($dir); # set $*CWD
chdir($dir, my $*CWD); # set $*CWD for the current scope

chtmpdir($dir); # set $*TMPDIR
chtmpdir($dir, my $*TMPDIR); # set $*TMPDIR for the current scope
print(@text); # print text on $*OUT
say(@text); # print text + newline on $*OUT
note(@text); # print text + newline on $*ERR
dd($a,$b,$c); # tiny data dumper on $*ERR
$line = prompt($message); # print message on $*OUT, obtain next line

chhomedir($dir); # set $*HOME
chhomedir($dir, my $*HOME); # set $*HOME for the current scope
$handle = open($path); # open a file, return IO::Handle

@relpaths = dir; # paths (as Str) in $*CWD
@relpaths = dir($dir); # paths (as Str) in $dir

@relpaths = glob($pattern); # paths (as Str) matching $pattern

$contents = slurp($handle); # read all that's left of an opened filehandle
Expand All @@ -223,6 +232,15 @@ references to S32-setting-library/IO.pod. An overview:
mkdir($dir); # create a directory
rmdir($dir); # remove a directory

chdir($dir); # set $*CWD
chdir($dir, my $*CWD); # set $*CWD for the current scope

chtmpdir($dir); # set $*TMPDIR
chtmpdir($dir, my $*TMPDIR); # set $*TMPDIR for the current scope

chhomedir($dir); # set $*HOME
chhomedir($dir, my $*HOME); # set $*HOME for the current scope

copy # copy a file
rename($from,$to); # rename (move) a file on same physical storage
move($from,$to); # move (rename) a file to other storage
Expand All @@ -233,11 +251,6 @@ references to S32-setting-library/IO.pod. An overview:
islink($target); # is the file a symbolic link?
readlink($target); # the destination of the symlink ($source)

print(@text); # print text on $*OUT
say(@text); # print text + newline on $*OUT
note(@text); # print text + newline on $*ERR
$line = prompt($message); # print message on $*OUT, obtain next line

=head3 IO::Testable Role

Role to be consumed by both C<IO::Path> as well as C<IO::Handle>.
Expand Down

0 comments on commit 0ba7481

Please sign in to comment.