Skip to content

Commit 04375ba

Browse files
authored
Merge pull request #2475 from perl6/frithnanth-patch-1
Add documentation to the test argument of sub/method dir
2 parents 9154c02 + 5055daf commit 04375ba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Type/IO/Path.pod6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,16 @@ representing relative paths, filtered by L<smartmatching|
504504
/language/operators#infix_~~> their names (as strings) against the C<:test>
505505
parameter.
506506
507+
Since the tests are performed against Str arguments, not IO, the tests are
508+
executed in the C<$*CWD>, instead of the target directory.
509+
When testing against file test operators, this won't work:
510+
511+
dir('mydir', test => { .IO.d })
512+
513+
while this will:
514+
515+
dir('mydir', test => { "mydir/$_".IO.d })
516+
507517
B<NOTE:> a C<dir> call opens a directory for reading, which counts towards
508518
maximum per-process open files for your program. Be sure to exhaust returned
509519
L<Seq> before doing something like recursively performing more C<dir> calls.

0 commit comments

Comments
 (0)