Skip to content

Commit

Permalink
Merge branch 'jvm-dir' of git://github.com/timo/rakudo into nom
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jul 1, 2013
2 parents 080a6bb + 1ca2ea2 commit 09be2b6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/core/IO.pm
Expand Up @@ -458,8 +458,24 @@ my class IO::Path is Cool does IO::FileTestable {
}
}
#?endif
#?if !parrot
die "dir is NYI on JVM backend";
#?if jvm
my Mu $dirh := nqp::opendir($!path);
my $next = 1;
gather {
take $_.path if $_ ~~ $test for ".", "..";
while $next {
my Str $elem := nqp::nextfiledir($dirh);
if nqp::isnull_s($elem) {
nqp::closedir($dirh);
$next = 0;
} else {
if $elem.substr(0, 2) eq "./" {
$elem := $elem.substr(2);
}
take $elem.path if $elem ~~ $test;
}
}
}
#?endif
}

Expand Down

0 comments on commit 09be2b6

Please sign in to comment.