Aion-Fs

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1};
$count # -> 3
```

## erase (@paths)

Удаляет файлы и пустые каталоги. Возвращает `@paths`. При ошибке ввода-вывода выбрасывает исключение.

```perl
eval { erase "/" }; $@  # ~> erase dir /: Device or resource busy
eval { erase "/dev/null" }; $@  # ~> erase file /dev/null: Permission denied
```

### See also

* `unlink` + `rmdir`.
* [File::Path](https://metacpan.org/pod/File::Path) – `remove_tree("dir")`.
* [File::Path::Tiny](https://metacpan.org/pod/File::Path::Tiny) – `File::Path::Tiny::rm($path)`. Не выбрасывает исключений.
* [Mojo::File](https://metacpan.org/pod/Mojo::File) – `path($file)->remove`.

lib/Aion/Fs.md  view on Meta::CPAN

my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1};
$count # -> 3
```

## erase (@paths)

Удаляет файлы и пустые каталоги. Возвращает `@paths`. При ошибке ввода-вывода выбрасывает исключение.

```perl
eval { erase "/" }; $@  # ~> erase dir /: Device or resource busy
eval { erase "/dev/null" }; $@  # ~> erase file /dev/null: Permission denied
```

### See also

* `unlink` + `rmdir`.
* [File::Path](https://metacpan.org/pod/File::Path) – `remove_tree("dir")`.
* [File::Path::Tiny](https://metacpan.org/pod/File::Path::Tiny) – `File::Path::Tiny::rm($path)`. Не выбрасывает исключений.
* [Mojo::File](https://metacpan.org/pod/Mojo::File) – `path($file)->remove`.

lib/Aion/Fs.pm  view on Meta::CPAN

Stops C<find> being called in one of its filters, C<errorenter> or C<noenter>.

	my $count = 0;
	find "ex", sub { find_stop if ++$count == 3; 1};
	$count # -> 3

=head2 erase (@paths)

Removes files and empty directories. Returns C<@paths>. If there is an I/O error, it throws an exception.

	eval { erase "/" }; $@  # ~> erase dir /: Device or resource busy
	eval { erase "/dev/null" }; $@  # ~> erase file /dev/null: Permission denied

=head3 See also

=over

=item * C<unlink> + C<rmdir>.

=item * L<File::Path> – C<remove_tree("dir")>.

t/aion/fs.t  view on Meta::CPAN

my $count = 0;
find "ex", sub { find_stop if ++$count == 3; 1};
local ($::_g0 = do {$count}, $::_e0 = do {3}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '$count # -> 3' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## erase (@paths)
# 
# Удаляет файлы и пустые каталоги. Возвращает `@paths`. При ошибке ввода-вывода выбрасывает исключение.
# 
::done_testing; }; subtest 'erase (@paths)' => sub { 
::like scalar do {eval { erase "/" }; $@}, qr{erase dir /: Device or resource busy}, 'eval { erase "/" }; $@  # ~> erase dir /: Device or resource busy'; undef $::_g0; undef $::_e0;
::like scalar do {eval { erase "/dev/null" }; $@}, qr{erase file /dev/null: Permission denied}, 'eval { erase "/dev/null" }; $@  # ~> erase file /dev/null: Permission denied'; undef $::_g0; undef $::_e0;

# 
# ### See also
# 
# * `unlink` + `rmdir`.
# * [File::Path](https://metacpan.org/pod/File::Path) – `remove_tree("dir")`.
# * [File::Path::Tiny](https://metacpan.org/pod/File::Path::Tiny) – `File::Path::Tiny::rm($path)`. Не выбрасывает исключений.
# * [Mojo::File](https://metacpan.org/pod/Mojo::File) – `path($file)->remove`.
# 



( run in 2.170 seconds using v1.01-cache-2.11-cpan-5735350b133 )