Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Wrap long lines for easier POD readability
This does not change any content.
  • Loading branch information
Paul Cochrane committed Jul 24, 2015
1 parent 8b02392 commit 89bc3de
Showing 1 changed file with 47 additions and 35 deletions.
82 changes: 47 additions & 35 deletions lib/Type/IO/Path.pod
Expand Up @@ -38,8 +38,8 @@ unless when stated otherwise.
multi method new(:$basename!, :$dirname = '.', :$volume = '')
Creates a new IO::Path object from a path string (which is being parsed for
volume, directory name and basename), or from volume, directory name and basename
passed as named arguments.
volume, directory name and basename), or from volume, directory name and
basename passed as named arguments.
=head2 method abspath
Expand All @@ -66,8 +66,8 @@ Returns the extension (if any) of the path object.
method dirname(IO::Path:D:)
Returns the directory name portion of the path object. That is, it returns the path
excluding the volume and the base name.
Returns the directory name portion of the path object. That is, it returns
the path excluding the volume and the base name.
say IO::Path.new("/etc/passwd").dirname; # /etc
Expand Down Expand Up @@ -107,15 +107,15 @@ single string, the method Str will return that string.
method open(IO::Path:D: *%opts)
Opens the path as a file; the named options control the mode, and are the same
as the L<open> function accepts.
Opens the path as a file; the named options control the mode, and are the
same as the L<open> function accepts.
=head2 method watch
method watch(IO::Path:D: --> Supply)
Watches the path for modifications. Only implemented in Rakudo with the MoarVM
backend at the moment.
Watches the path for modifications. Only implemented in Rakudo with the
MoarVM backend at the moment.
=head2 method is-absolute
Expand Down Expand Up @@ -146,7 +146,8 @@ Returns a new C<IO::Path> object relative to the C<$base> path.
sub dir(Cool $path = '.', Mu :$test = none('.', '..'))
method dir(IO::Path:D: Mu :$test = none('.', '..'))
Returns the contents of a directory as a lazy list of C<IO::Path> objects representing relative paths, filtered by L<smart-matching|
Returns the contents of a directory as a lazy list of C<IO::Path> objects
representing relative paths, filtered by L<smart-matching|
/language/operators#infix_~~> their names against the C<:test> parameter.
Examples:
Expand Down Expand Up @@ -185,15 +186,19 @@ An example program that lists all files and directories recursively:
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 processes notion of the current working directory (as found in C<$*CWD>.)
Alter the processes notion of the current working directory (as found in
C<$*CWD>.)
The subroutine and class method forms both change the directory relative to C<$*CWD> if the supplied C<$path> is not absolute.
The object method form changes the directory relative to the path of the invocant if C<$path> is not absolute.
The optional named parameter C<test> can specify a file test that should be applied to the target path if the operation is successful.
The subroutine and class method forms both change the directory relative to
C<$*CWD> if the supplied C<$path> is not absolute. The object method form
changes the directory relative to the path of the invocant if C<$path> is
not absolute. The optional named parameter C<test> can specify a file test
that should be applied to the target path if the operation is successful.
The default C<test> is that the directory is readable.
If the directory change is successful then the L<IO::Path|/lib/Type/IO/Path> representing the target directory is returned, otherwise it
will L<fail|/routine/fail> with L<X::IO::Chdir>.
If the directory change is successful then the L<IO::Path|/lib/Type/IO/Path>
representing the target directory is returned, otherwise it will
L<fail|/routine/fail> with L<X::IO::Chdir>.
=head2 routine mkdir
Expand Down Expand Up @@ -230,7 +235,8 @@ Changes the POSIX permissions of a file (or in the subroutine form, any number
of files) to C<$mode>.
The subroutine form returns the names of the files for which setting the new
mode was successful. The method form returns True on success, and otherwise L<fails|/routine/fail> with L<X::IO::Chmod>.
mode was successful. The method form returns True on success, and otherwise
L<fails|/routine/fail> with L<X::IO::Chmod>.
The mode is expected as an integer following the L<standard numeric notation|
http://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation>, and is
Expand All @@ -251,28 +257,28 @@ number (or string containing a decimal number):
sub rename($from, $to, :$createonly --> Bool);
Renames a file. Both C<$from> (the file to be renamed) and C<$to> (the
destination) can take arbitrary paths. If C<:createonly> is set to C<True>, the
rename fails if a file already exists in the destination. Returns C<True> upon
success, or L<fails|/routine/fail> with L<X::IO::Rename> if the operation could
not be completed.
destination) can take arbitrary paths. If C<:createonly> is set to C<True>,
the rename fails if a file already exists in the destination. Returns
C<True> upon success, or L<fails|/routine/fail> with L<X::IO::Rename> if the
operation could not be completed.
Please use L<move|/routine/move> if a file could not be moved by renaming (usually
because the destination is on a different physical storage device).
Please use L<move|/routine/move> if a file could not be moved by renaming
(usually because the destination is on a different physical storage device).
=head2 routine move
method move(IO::Path:D: $to, :$createonly)
sub move($from, $to, :$createonly);
Moves a file. Both C<$from> (the file to be moved) and C<$to> (the destination)
can take arbitrary paths. If C<:createonly> is set to C<True>, the move fails
if a file already exists in the destination. Returns C<True> upon success, or
L<fails|/routine/fail> with L<X::IO::Move> if the operation could not be
completed.
Moves a file. Both C<$from> (the file to be moved) and C<$to> (the
destination) can take arbitrary paths. If C<:createonly> is set to C<True>,
the move fails if a file already exists in the destination. Returns C<True>
upon success, or L<fails|/routine/fail> with L<X::IO::Move> if the operation
could not be completed.
Please use L<rename|/routine/rename> if a file can be moved by renaming (which is
usually possible if the destination is on the same different physical storage
device).
Please use L<rename|/routine/rename> if a file can be moved by renaming
(which is usually possible if the destination is on the same different
physical storage device).
B<NOTE>: This function has not yet been implemented in Rakudo.
Expand All @@ -281,18 +287,22 @@ B<NOTE>: This function has not yet been implemented in Rakudo.
method symlink(IO::Path:D: Str $name --> Bool);
sub symlink(Str $target, Str $name --> Bool);
Create a new symbolic link named as $target (or the name of the invocant in the method form,) to the existing file named C<$name>.
Create a new symbolic link named as $target (or the name of the invocant in
the method form,) to the existing file named C<$name>.
Both forms will return C<True> on success or L<fail|/routine/fail> with L<X::IO::Symlink> if the symbolic link could not be created.
Both forms will return C<True> on success or L<fail|/routine/fail> with
L<X::IO::Symlink> if the symbolic link could not be created.
=head2 routine link
method link(IO::Path:D: Str $name --> Bool);
sub link(Str $target, Str $name --> Bool);
Create a new link named as $target (or the name of the invocant in the method form,) to the existing file named C<$name>.
Create a new link named as $target (or the name of the invocant in the
method form,) to the existing file named C<$name>.
Both forms will return C<True> on success or L<fail|/routine/fail> with L<X::IO::Link> if the link operation could not be performed.
Both forms will return C<True> on success or L<fail|/routine/fail> with
L<X::IO::Link> if the link operation could not be performed.
=head2 routine unlink
Expand All @@ -302,7 +312,9 @@ Both forms will return C<True> on success or L<fail|/routine/fail> with L<X::IO:
Delete all specified ordinary files, links, or symbolic links.
The subroutine form returns the names of the files that were successfully
deleted. The method form returns C<True> on success, or L<fails|/routine/fail> with L<X::IO::Unlink> if the operation could not be completed.
deleted. The method form returns C<True> on success, or
L<fails|/routine/fail> with L<X::IO::Unlink> if the operation could not be
completed.
=head1 Related roles and classes
Expand Down

0 comments on commit 89bc3de

Please sign in to comment.