Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl6
- use v6;
- ### Recursive directory search function:
- my $build-log-regex = /build\.log/ ; # filename to search for
- my $start-dir = "/var/tmp/portage"; # directory to start in
- # say "/var/tmp/portage".IO.d;
- sub get-build-logs($current-dir) {
- for dir($current-dir) -> $item {
- if $item.IO.f {if $item.basename ~~ $build-log-regex {say $item;}}
- if $item.IO.d {get-build-logs($item);}
- }
- }
- # calling function
- get-build-logs($start-dir);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement