Skip to content

Commit

Permalink
Some reflow and rephrasing related to #2277
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Aug 27, 2018
1 parent 4789af9 commit 5984a29
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions doc/Type/IO/Spec/Win32.pod6
Expand Up @@ -6,17 +6,18 @@
class IO::Spec::Win32 is IO::Spec { }
Objects of this class are not used directly but as a sub-class specific to
the platform perl is running on via the C<$*SPEC> variable which will contain
an object of the appropriate type
Objects of this class are used not directly but as a sub-class specific
to the platform Perl 6 is running on via the C<$*SPEC> variable, which
will contain an object of the appropriate type.
B<NOTE:> the C<IO::Spec::*> classes provide low-level path operations. Unless
you're creating your own high-level path manipulation routines, you don't
need to use C<IO::Spec::*>. Use L«C<IO::Path>|/type/IO::Path» instead.
B<NOTE:> the C<IO::Spec::*> classes provide low-level path operations.
Unless you're creating your own high-level path manipulation routines,
you don't need to use C<IO::Spec::*>. Use L«C<IO::Path>|/type/IO::Path»
instead.
B<NOTE2:> no special validation is done by these classes (e.g. check whether
path contains a null character). It is the job of higher-level classes, like
L«C<IO::Path>|/type/IO::Path», to do that.
B<NOTE2:> no special validation is done by these classes (e.g. check
whether path contains a null character). It is the job of higher-level
classes, like L«C<IO::Path>|/type/IO::Path», to do that.
=head1 Methods
Expand All @@ -26,8 +27,8 @@ Defined as:
method basename(Str:D $path --> Str:D)
Takes a path as a string and returns a possibly-empty portion after the last
slash or backslash:
Takes a path as a string and returns a possibly-empty portion after the
last slash or backslash:
IO::Spec::Win32.basename("foo/bar/") .perl.say; # OUTPUT: «""␤»
IO::Spec::Win32.basename("foo/bar\\").perl.say; # OUTPUT: «""␤»
Expand Down Expand Up @@ -59,9 +60,9 @@ Defined as:
method catdir (*@parts --> Str:D)
Concatenates multiple path fragments and returns the canonical representation
of the resultant path as a string. The C<@parts> are L«C<Str>|/type/Str» objects
and are allowed to contain path separators.
Concatenates multiple path fragments and returns the canonical
representation of the resultant path as a string. The C<@parts> are
L«C<Str>|/type/Str» objects and are allowed to contain path separators.
IO::Spec::Win32.catdir(<foo/bar ber perl>).say;
# OUTPUT: «foo\bar\ber\perl␤»
Expand All @@ -77,9 +78,9 @@ Defined as:
method catpath (Str:D $volume, Str:D $dir, Str:D $file --> Str:D)
Concatenates a path from given volume, a chain of directories, and file.
An empty string can be given for any of the three arguments. No attempt to
make the path canonical is made. Use L«C<canonpath>|/routine/canonpath» for
that purpose.
An empty string can be given for any of the three arguments. No attempt
to make the path canonical is made. Use
L«C<canonpath>|/routine/canonpath» for that purpose.
IO::Spec::Win32.catpath('C:', '/some/dir', 'foo.txt').say;
# OUTPUT: «C:/some/dir\foo.txt␤»
Expand Down Expand Up @@ -111,7 +112,8 @@ Defined as:
method dir-sep(--> Str:D)
Returns the string C<「\」> representing canonical directory separator character.
Returns the string C<「\」> representing canonical directory separator
character.
=for code
IO::Spec::Win32.dir-sep.say; # OUTPUT: «\␤»
Expand All @@ -122,9 +124,9 @@ Defined as:
method is-absolute(Str:D $path --> Bool:D)
Returns C<True> if the C<$path> starts with a slash (C<"/">) or backslash
(C<"\">), even if they have combining character on them, optionally preceded by
a volume:
Returns C<True> if the C<$path> starts with a slash (C<"/">) or
backslash (C<"\">), even if they have combining character on them,
optionally preceded by a volume:
say IO::Spec::Win32.is-absolute: "/foo"; # OUTPUT: «True␤»
say IO::Spec::Win32.is-absolute: "/\x[308]foo"; # OUTPUT: «True␤»
Expand All @@ -145,11 +147,11 @@ Defined as:
method join (Str:D $volume, Str:D $dir, Str:D $file --> Str:D)
Similar to L«C<catpath>|/routine/catpath», takes two path fragments and
concatenates them, adding or removing a path separator, if necessary, except
it will return just C<$file> if both C<$dir> and C<$file> are string C<'/'>
or if C<$dir> is the string C<'.'>. The first argument is ignored (it exists to
maintain consistent interface with other C<IO::Spec> types for systems that have
volumes).
concatenates them, adding or removing a path separator, if necessary,
except it will return just C<$file> if both C<$dir> and C<$file> are
string C<'/'> or if C<$dir> is the string C<'.'>. The first argument is
ignored (it exists to maintain consistent interface with other
C<IO::Spec> types for systems that have volumes).
IO::Spec::Win32.join('C:', '/some/dir', 'foo.txt').say;
# OUTPUT: «C:/some/dir\and/more␤»
Expand Down

0 comments on commit 5984a29

Please sign in to comment.