Skip to content

Commit

Permalink
[io grant] Finish up IO::Path.dir docs
Browse files Browse the repository at this point in the history
- Fix up formatting
- Mention `test` tests against Str names, not IO::Paths
- Use proper $*HOME instead of env var and don't stringify IO::Paths
  • Loading branch information
zoffixznet committed May 13, 2017
1 parent 88f4beb commit 4432ef3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/Type/IO/Path.pod6
Expand Up @@ -401,7 +401,8 @@ Defined as:
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.
/language/operators#infix_~~> their names (as strings) against the C<:test>
parameter.
B<NOTE:> a C<dir> call opens a directory for reading, which counts towards
maximum per-process open files for your program. Be sure to exhaust returned
Expand All @@ -414,6 +415,7 @@ control over closing dir handles.
Examples:
=begin code :skip-test
# To iterate over the contents of the current directory:
for dir() -> $file {
say $file;
Expand All @@ -426,8 +428,8 @@ Examples:
}
# To get the names of all .jpg and .jpeg files in ~/Downloads:
=for code :skip-test
my @jpegs = "%*ENV<HOME>/Downloads".IO.dir(test => /:i '.' jpe?g $/)».Str;
my @jpegs = $*HOME.dir: test => /:i '.' jpe?g $/;
=end
=comment TODO: Turn the following into a FAQ entry, and link to it from here.
Expand Down

0 comments on commit 4432ef3

Please sign in to comment.