Aion-Fs
view release on metacpan or search on metacpan
- change translate from ru to en
0.0.8 2024-11-08T16:27:58Z
- add subroutines "path" and "transpath" with more OS
0.0.7 2024-09-17T22:22:33Z
- add subroutines path and sta. sta while on ro
- find optimize by memory
- find safe use $_ in filters, noenter and errorenter
- find may be stop with find_stop
0.0.6 2023-11-15T09:59:00Z
- add unsupported os
0.0.5 2023-11-15T09:28:51Z
- fix pod
lay mkpath "hello/big/world.txt", "hellow!";
lay mkpath "hello/small/world.txt", "noenter";
mtime "hello" # ~> ^\d+(\.\d+)?$
[map cat, grep -f, find ["hello/big", "hello/small"]] # --> [qw/ hellow! noenter /]
my @noreplaced = replace { s/h/$a $b H/ }
find "hello", "-f", "*.txt", qr/\.txt$/, sub { /\.txt$/ },
noenter "*small*",
errorenter { warn "find $_: $!" };
\@noreplaced # --> ["hello/moon.txt"]
cat "hello/world.txt" # => hello/world.txt :utf8 Hi!
cat "hello/moon.txt" # => noreplace
cat "hello/big/world.txt" # => hello/big/world.txt :utf8 Hellow!
cat "hello/small/world.txt" # => noenter
[find "hello", "*.txt"] # --> [qw! hello/moon.txt hello/world.txt hello/big/world.txt hello/small/world.txt !]
[find "hello", "-d"] # --> [qw! hello hello/big hello/small !]
* ÐÑÑалÑнÑе ÑÑÑоки пÑевÑаÑаÑÑÑÑ ÑÑнкÑией `wildcard` (Ñм. ниже) в ÑегÑлÑÑное вÑÑажение Ð´Ð»Ñ Ð¿ÑовеÑки каждого пÑÑи.
ÐÑÑи, не пÑоÑедÑие пÑовеÑÐºÑ `@filters`, не возвÑаÑаÑÑÑÑ.
ÐÑли ÑилÑÑÑ -X не ÑвлÑеÑÑÑ Ñайловой ÑÑнкÑией perl, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение:
```perl
eval { find "example", "-h" }; $@ # ~> Undefined subroutine &Aion::Fs::h called
```
Ð ÑÑом пÑимеÑе `find` не Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð¹Ñи в подкаÑалог и пеÑедаÑÑ Ð¾ÑÐ¸Ð±ÐºÑ Ð² ÑÑнкÑÐ¸Ñ `errorenter` (Ñм. ниже) Ñ ÑÑÑановленнÑми пеÑеменнÑми `$_` и `$!` (пÑÑÑм к Ð...
**Ðнимание!** ÐÑли `errorenter` не Ñказана, Ñо вÑе оÑибки **игноÑиÑÑÑÑÑÑ**!
```perl
mkpath ["example/", 0];
[find "example"] # --> ["example"]
[find "example", noenter "-d"] # --> ["example"]
eval { find "example", errorenter { die "find $_: $!" } }; $@ # ~> find example: Permission denied
mkpath for qw!ex/1/11 ex/1/12 ex/2/21 ex/2/22!;
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
```
### See also
* [AudioFile::Find](https://metacpan.org/pod/AudioFile::Find) â иÑÐµÑ Ð°ÑдиоÑÐ°Ð¹Ð»Ñ Ð² Ñказанной диÑекÑоÑии. ÐозволÑÐµÑ ÑилÑÑÑоваÑÑ Ð¸Ñ
по аÑÑибÑÑам: названиÑ, аÑÑиÑÑÑ, жа...
* [Path::Extended::Dir](https://metacpan.org/pod/Path::Extended::Dir) â `@paths = Path::Extended::Dir->new($dir)->find('*.txt')`.
* [Path::Iterator::Rule](https://metacpan.org/pod/Path::Iterator::Rule) â `$i = Path::Iterator::Rule->new->file; @paths = $i->clone->size(">10k")->all(@dirs); $i->size("<10k")...`.
* [Path::Class::Each](https://metacpan.org/pod/Path::Class::Each) â `dir($dir)->each(sub { push @paths, "$_" })`.
* [Path::Class::Iterator](https://metacpan.org/pod/Path::Class::Iterator) â `$i = Path::Class::Iterator->new(root => $dir, depth => 2); until ($i->done) { push @paths, $i->next->stringify }`.
* [Path::Class::Rule](https://metacpan.org/pod/Path::Class::Rule) â `@paths = Path::Class::Rule->new->file->size(">10k")->all($dir)`.
## noenter (@filters)
ÐовоÑÐ¸Ñ `find` не вÑ
одиÑÑ Ð² каÑалоги ÑооÑвеÑÑÑвÑÑÑие ÑилÑÑÑам за ним.
## errorenter (&block)
ÐÑзÑÐ²Ð°ÐµÑ `&block` Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð¹ оÑибки возникаÑÑей пÑи невозможноÑÑи войÑи в какой-либо каÑалог.
## find_stop ()
ÐÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ `find` бÑдÑÑи вÑзван в одном из его ÑилÑÑÑов, `errorenter` или `noenter`.
```perl
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
```
## erase (@paths)
УдалÑÐµÑ ÑÐ°Ð¹Ð»Ñ Ð¸ пÑÑÑÑе каÑалоги. ÐозвÑаÑÐ°ÐµÑ `@paths`. ÐÑи оÑибке ввода-вÑвода вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑение.
lib/Aion/Fs.md view on Meta::CPAN
lay mkpath "hello/big/world.txt", "hellow!";
lay mkpath "hello/small/world.txt", "noenter";
mtime "hello" # ~> ^\d+(\.\d+)?$
[map cat, grep -f, find ["hello/big", "hello/small"]] # --> [qw/ hellow! noenter /]
my @noreplaced = replace { s/h/$a $b H/ }
find "hello", "-f", "*.txt", qr/\.txt$/, sub { /\.txt$/ },
noenter "*small*",
errorenter { warn "find $_: $!" };
\@noreplaced # --> ["hello/moon.txt"]
cat "hello/world.txt" # => hello/world.txt :utf8 Hi!
cat "hello/moon.txt" # => noreplace
cat "hello/big/world.txt" # => hello/big/world.txt :utf8 Hellow!
cat "hello/small/world.txt" # => noenter
[find "hello", "*.txt"] # --> [qw! hello/moon.txt hello/world.txt hello/big/world.txt hello/small/world.txt !]
[find "hello", "-d"] # --> [qw! hello hello/big hello/small !]
lib/Aion/Fs.md view on Meta::CPAN
* ÐÑÑалÑнÑе ÑÑÑоки пÑевÑаÑаÑÑÑÑ ÑÑнкÑией `wildcard` (Ñм. ниже) в ÑегÑлÑÑное вÑÑажение Ð´Ð»Ñ Ð¿ÑовеÑки каждого пÑÑи.
ÐÑÑи, не пÑоÑедÑие пÑовеÑÐºÑ `@filters`, не возвÑаÑаÑÑÑÑ.
ÐÑли ÑилÑÑÑ -X не ÑвлÑеÑÑÑ Ñайловой ÑÑнкÑией perl, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение:
```perl
eval { find "example", "-h" }; $@ # ~> Undefined subroutine &Aion::Fs::h called
```
Ð ÑÑом пÑимеÑе `find` не Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð¹Ñи в подкаÑалог и пеÑедаÑÑ Ð¾ÑÐ¸Ð±ÐºÑ Ð² ÑÑнкÑÐ¸Ñ `errorenter` (Ñм. ниже) Ñ ÑÑÑановленнÑми пеÑеменнÑми `$_` и `$!` (пÑÑÑм к Ð...
**Ðнимание!** ÐÑли `errorenter` не Ñказана, Ñо вÑе оÑибки **игноÑиÑÑÑÑÑÑ**!
```perl
mkpath ["example/", 0];
[find "example"] # --> ["example"]
[find "example", noenter "-d"] # --> ["example"]
eval { find "example", errorenter { die "find $_: $!" } }; $@ # ~> find example: Permission denied
mkpath for qw!ex/1/11 ex/1/12 ex/2/21 ex/2/22!;
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
```
### See also
* [AudioFile::Find](https://metacpan.org/pod/AudioFile::Find) â иÑÐµÑ Ð°ÑдиоÑÐ°Ð¹Ð»Ñ Ð² Ñказанной диÑекÑоÑии. ÐозволÑÐµÑ ÑилÑÑÑоваÑÑ Ð¸Ñ
по аÑÑибÑÑам: названиÑ, аÑÑиÑÑÑ, жа...
lib/Aion/Fs.md view on Meta::CPAN
* [Path::Extended::Dir](https://metacpan.org/pod/Path::Extended::Dir) â `@paths = Path::Extended::Dir->new($dir)->find('*.txt')`.
* [Path::Iterator::Rule](https://metacpan.org/pod/Path::Iterator::Rule) â `$i = Path::Iterator::Rule->new->file; @paths = $i->clone->size(">10k")->all(@dirs); $i->size("<10k")...`.
* [Path::Class::Each](https://metacpan.org/pod/Path::Class::Each) â `dir($dir)->each(sub { push @paths, "$_" })`.
* [Path::Class::Iterator](https://metacpan.org/pod/Path::Class::Iterator) â `$i = Path::Class::Iterator->new(root => $dir, depth => 2); until ($i->done) { push @paths, $i->next->stringify }`.
* [Path::Class::Rule](https://metacpan.org/pod/Path::Class::Rule) â `@paths = Path::Class::Rule->new->file->size(">10k")->all($dir)`.
## noenter (@filters)
ÐовоÑÐ¸Ñ `find` не вÑ
одиÑÑ Ð² каÑалоги ÑооÑвеÑÑÑвÑÑÑие ÑилÑÑÑам за ним.
## errorenter (&block)
ÐÑзÑÐ²Ð°ÐµÑ `&block` Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð¹ оÑибки возникаÑÑей пÑи невозможноÑÑи войÑи в какой-либо каÑалог.
## find_stop ()
ÐÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ `find` бÑдÑÑи вÑзван в одном из его ÑилÑÑÑов, `errorenter` или `noenter`.
```perl
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
```
## erase (@paths)
УдалÑÐµÑ ÑÐ°Ð¹Ð»Ñ Ð¸ пÑÑÑÑе каÑалоги. ÐозвÑаÑÐ°ÐµÑ `@paths`. ÐÑи оÑибке ввода-вÑвода вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑение.
lib/Aion/Fs.pm view on Meta::CPAN
if(ref $path eq "HASH") {
local $_ = $path;
return $fs->{join}->();
}
($path) = @$path if ref $path;
$path = $fs->{before_split}->($path) if exists $fs->{before_split};
+{
$path =~ $fs->{regexp}? (map { $_ ne "ext" && $+{$_} eq ""? (): ($_ => $+{$_}) } keys %+): (error => 1),
path => $path,
}
}
# ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿ÑÑÑ Ð¸Ð· ÑоÑмаÑа одной ÐС в дÑÑгÑÑ
sub transpath ($$;$) {
my ($path, $from, $to) = @_ == 2? ($_, @_): @_;
my (@dir, @folder, @ext);
{ local $^O = $from;
$path = path $path;
lib/Aion/Fs.pm view on Meta::CPAN
}
else { my $re = wildcard(); sub { $_ =~ $re } }
} @_
}
# ÐайÑи ÑайлÑ
sub find(;@) {
my $file = @_? shift: $_;
$file = [$file] unless ref $file;
my @noenters; my $errorenter = sub {};
my $ex = @_ && ref($_[$#_]) =~ /^Aion::Fs::(noenter|errorenter)\z/ ? pop: undef;
if($ex) {
if($1 eq "errorenter") {
$errorenter = $ex;
} else {
$errorenter = pop @$ex if ref $ex->[$#$ex] eq "Aion::Fs::errorenter";
push @noenters, _filters @$ex;
}
}
my @filters = _filters @_;
my $wantarray = wantarray;
my @ret; my $count;
eval {
lib/Aion/Fs.pm view on Meta::CPAN
# Ðе деÑжим памÑÑÑ, еÑли ÑÑо не нÑжно
if($wantarray) { push @ret, $path } else { $count++ }
DIR: if(-d $path) {
for my $noenter (@noenters) {
local $_ = $path;
next FILE if $noenter->();
}
opendir my $dir, $path or do { local $_ = $path; $errorenter->(); next FILE };
my @file;
while(my $f = readdir $dir) {
push @file, File::Spec->join($path, $f) if $f !~ /^\.{1,2}\z/;
}
push @$file, sort @file;
closedir $dir;
}
}
};
lib/Aion/Fs.pm view on Meta::CPAN
wantarray? @ret: $count
}
# Ðе вÑ
одиÑÑ Ð² подкаÑалоги
sub noenter(@) {
bless [@_], "Aion::Fs::noenter"
}
# ÐÑзÑваеÑÑÑ Ð´Ð»Ñ Ð²ÑеÑ
оÑибок ввода-вÑвода
sub errorenter(&) {
bless shift, "Aion::Fs::errorenter"
}
# ÐÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ find бÑдÑÑи вÑзван Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ из его ÑилÑÑÑов, errorenter или noenter
sub find_stop() {
die bless {}, "Aion::Fs::stop"
}
# ÐÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ Ð·Ð°Ð¼ÐµÐ½Ñ Ð²Ð¾ вÑеÑ
ÑказаннÑÑ
ÑайлаÑ
. ÐозвÑаÑÐ°ÐµÑ ÑÐ°Ð¹Ð»Ñ Ð² коÑоÑÑÑ
замен не бÑло
sub replace(&@) {
my $fn = shift;
my @noreplace; local $_; my $pkg = caller;
my $aref = "${pkg}::a"; my $bref = "${pkg}::b";
for $$aref (@_) {
lib/Aion/Fs.pm view on Meta::CPAN
lay mkpath "hello/big/world.txt", "hellow!";
lay mkpath "hello/small/world.txt", "noenter";
mtime "hello" # ~> ^\d+(\.\d+)?$
[map cat, grep -f, find ["hello/big", "hello/small"]] # --> [qw/ hellow! noenter /]
my @noreplaced = replace { s/h/$a $b H/ }
find "hello", "-f", "*.txt", qr/\.txt$/, sub { /\.txt$/ },
noenter "*small*",
errorenter { warn "find $_: $!" };
\@noreplaced # --> ["hello/moon.txt"]
cat "hello/world.txt" # => hello/world.txt :utf8 Hi!
cat "hello/moon.txt" # => noreplace
cat "hello/big/world.txt" # => hello/big/world.txt :utf8 Hellow!
cat "hello/small/world.txt" # => noenter
[find "hello", "*.txt"] # --> [qw! hello/moon.txt hello/world.txt hello/big/world.txt hello/small/world.txt !]
[find "hello", "-d"] # --> [qw! hello hello/big hello/small !]
lib/Aion/Fs.pm view on Meta::CPAN
=item * ÐÑÑалÑнÑе ÑÑÑоки пÑевÑаÑаÑÑÑÑ ÑÑнкÑией C<wildcard> (Ñм. ниже) в ÑегÑлÑÑное вÑÑажение Ð´Ð»Ñ Ð¿ÑовеÑки каждого пÑÑи.
=back
ÐÑÑи, не пÑоÑедÑие пÑовеÑÐºÑ C<@filters>, не возвÑаÑаÑÑÑÑ.
ÐÑли ÑилÑÑÑ -X не ÑвлÑеÑÑÑ Ñайловой ÑÑнкÑией perl, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение:
eval { find "example", "-h" }; $@ # ~> Undefined subroutine &Aion::Fs::h called
Ð ÑÑом пÑимеÑе C<find> не Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð¹Ñи в подкаÑалог и пеÑедаÑÑ Ð¾ÑÐ¸Ð±ÐºÑ Ð² ÑÑнкÑÐ¸Ñ C<errorenter> (Ñм. ниже) Ñ ÑÑÑановленнÑми пеÑеменнÑми C<$_> и C<$!> (пÑÑÑм ...
B<Ðнимание!> ÐÑли C<errorenter> не Ñказана, Ñо вÑе оÑибки B<игноÑиÑÑÑÑÑÑ>!
mkpath ["example/", 0];
[find "example"] # --> ["example"]
[find "example", noenter "-d"] # --> ["example"]
eval { find "example", errorenter { die "find $_: $!" } }; $@ # ~> find example: Permission denied
mkpath for qw!ex/1/11 ex/1/12 ex/2/21 ex/2/22!;
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
=head3 See also
=over
lib/Aion/Fs.pm view on Meta::CPAN
=item * L<Path::Class::Iterator> â C<< $i = Path::Class::Iterator-E<gt>new(root =E<gt> $dir, depth =E<gt> 2); until ($i-E<gt>done) { push @paths, $i-E<gt>next-E<gt>stringify } >>.
=item * L<Path::Class::Rule> â C<< @paths = Path::Class::Rule-E<gt>new-E<gt>file-E<gt>size("E<gt>10k")-E<gt>all($dir) >>.
=back
=head2 noenter (@filters)
ÐовоÑÐ¸Ñ C<find> не вÑ
одиÑÑ Ð² каÑалоги ÑооÑвеÑÑÑвÑÑÑие ÑилÑÑÑам за ним.
=head2 errorenter (&block)
ÐÑзÑÐ²Ð°ÐµÑ C<&block> Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð¹ оÑибки возникаÑÑей пÑи невозможноÑÑи войÑи в какой-либо каÑалог.
=head2 find_stop ()
ÐÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ C<find> бÑдÑÑи вÑзван в одном из его ÑилÑÑÑов, C<errorenter> или C<noenter>.
my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1} # -> 2
=head2 erase (@paths)
УдалÑÐµÑ ÑÐ°Ð¹Ð»Ñ Ð¸ пÑÑÑÑе каÑалоги. ÐозвÑаÑÐ°ÐµÑ C<@paths>. ÐÑи оÑибке ввода-вÑвода вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑение.
eval { erase "/" }; $@ # ~> erase dir /: Device or resource busy
eval { erase "/dev/null" }; $@ # ~> erase file /dev/null: Permission denied
t/aion/fs.t view on Meta::CPAN
lay mkpath "hello/big/world.txt", "hellow!";
lay mkpath "hello/small/world.txt", "noenter";
::like scalar do {mtime "hello"}, qr!^\d+(\.\d+)?$!, 'mtime "hello" # ~> ^\d+(\.\d+)?$';
::is_deeply scalar do {[map cat, grep -f, find ["hello/big", "hello/small"]]}, scalar do {[qw/ hellow! noenter /]}, '[map cat, grep -f, find ["hello/big", "hello/small"]] # --> [qw/ hellow! noenter /]';
my @noreplaced = replace { s/h/$a $b H/ }
find "hello", "-f", "*.txt", qr/\.txt$/, sub { /\.txt$/ },
noenter "*small*",
errorenter { warn "find $_: $!" };
::is_deeply scalar do {\@noreplaced}, scalar do {["hello/moon.txt"]}, '\@noreplaced # --> ["hello/moon.txt"]';
::is scalar do {cat "hello/world.txt"}, "hello/world.txt :utf8 Hi!", 'cat "hello/world.txt" # => hello/world.txt :utf8 Hi!';
::is scalar do {cat "hello/moon.txt"}, "noreplace", 'cat "hello/moon.txt" # => noreplace';
::is scalar do {cat "hello/big/world.txt"}, "hello/big/world.txt :utf8 Hellow!", 'cat "hello/big/world.txt" # => hello/big/world.txt :utf8 Hellow!';
::is scalar do {cat "hello/small/world.txt"}, "noenter", 'cat "hello/small/world.txt" # => noenter';
::is_deeply scalar do {[find "hello", "*.txt"]}, scalar do {[qw! hello/moon.txt hello/world.txt hello/big/world.txt hello/small/world.txt !]}, '[find "hello", "*.txt"] # --> [qw! hello/moon.txt hello/world.txt hello/big/world.txt hello/smal...
::is_deeply scalar do {[find "hello", "-d"]}, scalar do {[qw! hello hello/big hello/small !]}, '[find "hello", "-d"] # --> [qw! hello hello/big hello/small !]';
t/aion/fs.t view on Meta::CPAN
# * ÐÑÑалÑнÑе ÑÑÑоки пÑевÑаÑаÑÑÑÑ ÑÑнкÑией `wildcard` (Ñм. ниже) в ÑегÑлÑÑное вÑÑажение Ð´Ð»Ñ Ð¿ÑовеÑки каждого пÑÑи.
#
# ÐÑÑи, не пÑоÑедÑие пÑовеÑÐºÑ `@filters`, не возвÑаÑаÑÑÑÑ.
#
# ÐÑли ÑилÑÑÑ -X не ÑвлÑеÑÑÑ Ñайловой ÑÑнкÑией perl, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение:
#
done_testing; }; subtest 'find (;$path, @filters)' => sub {
::like scalar do {eval { find "example", "-h" }; $@}, qr!Undefined subroutine &Aion::Fs::h called!, 'eval { find "example", "-h" }; $@ # ~> Undefined subroutine &Aion::Fs::h called';
#
# Ð ÑÑом пÑимеÑе `find` не Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð¹Ñи в подкаÑалог и пеÑедаÑÑ Ð¾ÑÐ¸Ð±ÐºÑ Ð² ÑÑнкÑÐ¸Ñ `errorenter` (Ñм. ниже) Ñ ÑÑÑановленнÑми пеÑеменнÑми `$_` и `$!` (пÑÑÑм к...
#
# **Ðнимание!** ÐÑли `errorenter` не Ñказана, Ñо вÑе оÑибки **игноÑиÑÑÑÑÑÑ**!
#
mkpath ["example/", 0];
::is_deeply scalar do {[find "example"]}, scalar do {["example"]}, '[find "example"] # --> ["example"]';
::is_deeply scalar do {[find "example", noenter "-d"]}, scalar do {["example"]}, '[find "example", noenter "-d"] # --> ["example"]';
::like scalar do {eval { find "example", errorenter { die "find $_: $!" } }; $@}, qr!find example: Permission denied!, 'eval { find "example", errorenter { die "find $_: $!" } }; $@ # ~> find example: Permission denied';
mkpath for qw!ex/1/11 ex/1/12 ex/2/21 ex/2/22!;
my $count = 0;
::is scalar do {find "ex", sub { find_stop if ++$count == 3; 1}}, scalar do{2}, 'find "ex", sub { find_stop if ++$count == 3; 1} # -> 2';
#
# ### See also
#
# * [AudioFile::Find](https://metacpan.org/pod/AudioFile::Find) â иÑÐµÑ Ð°ÑдиоÑÐ°Ð¹Ð»Ñ Ð² Ñказанной диÑекÑоÑии. ÐозволÑÐµÑ ÑилÑÑÑоваÑÑ Ð¸Ñ
по аÑÑибÑÑам: названиÑ, аÑÑиÑÑÑ, ж...
t/aion/fs.t view on Meta::CPAN
# * [Path::Extended::Dir](https://metacpan.org/pod/Path::Extended::Dir) â `@paths = Path::Extended::Dir->new($dir)->find('*.txt')`.
# * [Path::Iterator::Rule](https://metacpan.org/pod/Path::Iterator::Rule) â `$i = Path::Iterator::Rule->new->file; @paths = $i->clone->size(">10k")->all(@dirs); $i->size("<10k")...`.
# * [Path::Class::Each](https://metacpan.org/pod/Path::Class::Each) â `dir($dir)->each(sub { push @paths, "$_" })`.
# * [Path::Class::Iterator](https://metacpan.org/pod/Path::Class::Iterator) â `$i = Path::Class::Iterator->new(root => $dir, depth => 2); until ($i->done) { push @paths, $i->next->stringify }`.
# * [Path::Class::Rule](https://metacpan.org/pod/Path::Class::Rule) â `@paths = Path::Class::Rule->new->file->size(">10k")->all($dir)`.
#
# ## noenter (@filters)
#
# ÐовоÑÐ¸Ñ `find` не вÑ
одиÑÑ Ð² каÑалоги ÑооÑвеÑÑÑвÑÑÑие ÑилÑÑÑам за ним.
#
# ## errorenter (&block)
#
# ÐÑзÑÐ²Ð°ÐµÑ `&block` Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð¹ оÑибки возникаÑÑей пÑи невозможноÑÑи войÑи в какой-либо каÑалог.
#
# ## find_stop ()
#
# ÐÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ `find` бÑдÑÑи вÑзван в одном из его ÑилÑÑÑов, `errorenter` или `noenter`.
#
done_testing; }; subtest 'find_stop ()' => sub {
my $count = 0;
::is scalar do {find "ex", sub { find_stop if ++$count == 3; 1}}, scalar do{2}, 'find "ex", sub { find_stop if ++$count == 3; 1} # -> 2';
#
# ## erase (@paths)
#
# УдалÑÐµÑ ÑÐ°Ð¹Ð»Ñ Ð¸ пÑÑÑÑе каÑалоги. ÐозвÑаÑÐ°ÐµÑ `@paths`. ÐÑи оÑибке ввода-вÑвода вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑение.
#
( run in 0.641 second using v1.01-cache-2.11-cpan-65fba6d93b7 )