Aion-Fs

 view release on metacpan or  search on metacpan

i18n/Aion/Fs.ru-en.po  view on Meta::CPAN

msgstr "* OOP – object-oriented programming.\n"
"* FP – functional programming."

msgid "Считывает файл. Если параметр не указан, использует `$_`."
msgstr "Reads the file. If no parameter is specified, use `$_`."

msgid "`cat` читает со слоем `:utf8`. Но можно указать другой слой следующим образом:"
msgstr "`cat` reads with layer `:utf8`. But you can specify another layer like this:"

msgid "`cat` вызывает исключение в случае ошибки операции ввода-вывода:"
msgstr "`cat` throws an exception if the I/O operation fails:"

msgid ""
"* [autodie](https://metacpan.org/pod/autodie) – `open $f, \"r.txt\"; $s = join \"\", <$f>; close $f`.\n"
"* [File::Slurp](https://metacpan.org/pod/File::Slurp) – `read_file('file.txt')`.\n"
"* [File::Slurper](https://metacpan.org/pod/File::Slurper) – `read_text('file.txt')`, `read_binary('file.txt')`.\n"
"* [File::Util](https://metacpan.org/pod/File::Util) – `File::Util->new->load_file(file => 'file.txt')`.\n"
"* [IO::All](https://metacpan.org/pod/IO::All) – `io('file.txt') > $contents`.\n"
"* [IO::Util](https://metacpan.org/pod/IO::Util) – `$contents = ${ slurp 'file.txt' }`.\n"
"* [Mojo::File](https://metacpan.org/pod/Mojo::File) – `path($file)->slurp`."
msgstr ""

i18n/Aion/Fs.ru-en.po  view on Meta::CPAN

msgstr ""
"* By subroutine - the path to the current file is passed to `$_`, and the subroutine must return true or false, as understood by Perl.\n"
"* Regexp – tests each path with a regular expression.\n"
"* String in the form \"-Xxx\", where `Xxx` is one or more characters. Similar to Perl operators for testing files. Example: `-fr` checks the path with file testers [-f and -r](https://perldoc.perl.org/functions/-X).\n"
"* The remaining lines are turned by the `wildcard` function (see below) into a regular expression to test each path."

msgid "Пути, не прошедшие проверку `@filters`, не возвращаются."
msgstr "Paths that fail the `@filters` check are not returned."

msgid "Если фильтр -X не является файловой функцией perl, то выбрасывается исключение:"
msgstr "If the -X filter is not a perl file function, an exception is thrown:"

msgid "В этом примере `find` не может войти в подкаталог и передаёт ошибку в функцию `errorenter` (см. ниже) с установленными переменными `$_` и `$!` (путё...
msgstr "In this example, `find` cannot enter the subdirectory and passes an error to the `errorenter` function (see below) with the `$_` and `$!` variables set (to the directory path and the OS error message)."

msgid "**Внимание!** Если `errorenter` не указана, то все ошибки **игнорируются**!"
msgstr "**Attention!** If `errorenter` is not specified, then all errors are **ignored**!"

msgid ""
"* [AudioFile::Find](https://metacpan.org/pod/AudioFile::Find) – ищет аудиофайлы в указанной директории. Позволяет фильтровать их по атрибутам: названию, артисту, жÐ...
"* [Directory::Iterator](https://metacpan.org/pod/Directory::Iterator) – `$it = Directory::Iterator->new($dir, %opts); push @paths, $_ while <$it>`.\n"

i18n/Aion/Fs.ru-en.po  view on Meta::CPAN

msgid "Говорит `find` не входить в каталоги соответствующие фильтрам за ним."
msgstr "Tells `find` not to enter directories matching the filters behind it."

msgid "Вызывает `&block` для каждой ошибки возникающей при невозможности войти в какой-либо каталог."
msgstr "Calls `&block` for every error that occurs when a directory cannot be entered."

msgid "Останавливает `find` будучи вызван в одном из его фильтров, `errorenter` или `noenter`."
msgstr "Stops `find` being called in one of its filters, `errorenter` or `noenter`."

msgid "Удаляет файлы и пустые каталоги. Возвращает `@paths`. При ошибке ввода-вывода выбрасывает исключение."
msgstr "Removes files and empty directories. Returns `@paths`. If there is an I/O error, it throws an exception."

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

msgid "Заменяет каждый файл на `$_`, если его изменяет `&sub`. Возвращает файлы, в которых не было замен."
msgstr "Replaces each file with `$_` if it is modified by `&sub`. Returns files that have no replacements."

msgid "`@files` может содержать массивы из двух элементов. Первый рассматривается как путь, а второй – как слой. Слой по умолчанию – `:utf8`."
msgstr "`@files` can contain arrays of two elements. The first is considered as a path, and the second as a layer. The default layer is `:utf8`."

msgid "`&sub` вызывается для каждого файла из `@files`. В неё передаются:"
msgstr "`&sub` is called for each file in `@files`. It transmits:"

i18n/Aion/Fs.ru-en.po  view on Meta::CPAN

"* Возвращает `$path`."
msgstr ""
"* If `$path` is not specified, use `$_`.\n"
"* If `$path` is an array reference, then the path is used as the first element and rights as the second element.\n"
"* Default permissions are `0755`.\n"
"* Returns `$path`."

msgid "* [File::Path](https://metacpan.org/pod/File::Path) – `mkpath(\"dir1/dir2\")`.\n"
"* [File::Path::Tiny](https://metacpan.org/pod/File::Path::Tiny) – `File::Path::Tiny::mk($path)`. Не выбрасывает исключений."
msgstr "* [File::Path](https://metacpan.org/pod/File::Path) – `mkpath(\"dir1/dir2\")`.\n"
"* [File::Path::Tiny](https://metacpan.org/pod/File::Path::Tiny) – `File::Path::Tiny::mk($path)`. Does not throw exceptions."

msgid "Время модификации `$path` в unixtime с дробной частью (из `Time::HiRes::stat`). Без параметра использует `$_`."
msgstr "Modification time of `$path` in unixtime with fractional part (from `Time::HiRes::stat`). Without a parameter, uses `$_`."

msgid ""
"* `-M` – `-M \"file.txt\"`, `-M _` в днях от текущего времени.\n"
"* [stat](https://metacpan.org/pod/stat) – `(stat \"file.txt\")[9]` в секундах (unixtime).\n"
"* [Time::HiRes](https://metacpan.org/pod/Time::HiRes) – `(Time::HiRes::stat \"file.txt\")[9]` в секундах с дробной частью.\n"
"* [Mojo::File](https://metacpan.org/pod/Mojo::File) – `path($file)->stat->mtime`."
msgstr ""

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

Reads the file. If no parameter is specified, use C<$_>.

	cat "/etc/passwd"  # ~> root

C<cat> reads with layer C<:utf8>. But you can specify another layer like this:

	lay "unicode.txt", "↯";
	length cat "unicode.txt"            # -> 1
	length cat["unicode.txt", ":raw"]   # -> 3

C<cat> throws an exception if the I/O operation fails:

	eval { cat "A" }; $@  # ~> cat A: No such file or directory

=head3 See also

=over

=item * L<autodie> – C<< open $f, "r.txt"; $s = join "", E<lt>$fE<gt>; close $f >>.

=item * L<File::Slurp> – C<read_file('file.txt')>.

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

=item * Regexp – tests each path with a regular expression.

=item * String in the form "-Xxx", where C<Xxx> is one or more characters. Similar to Perl operators for testing files. Example: C<-fr> checks the path with file testers LLL<https://perldoc.perl.org/functions/-X>.

=item * The remaining lines are turned by the C<wildcard> function (see below) into a regular expression to test each path.

=back

Paths that fail the C<@filters> check are not returned.

If the -X filter is not a perl file function, an exception is thrown:

	eval { find "example", "-h" }; $@   # ~> Undefined subroutine &Aion::Fs::h called

In this example, C<find> cannot enter the subdirectory and passes an error to the C<errorenter> function (see below) with the C<$_> and C<$!> variables set (to the directory path and the OS error message).

B<Attention!> If C<errorenter> is not specified, then all errors are B<ignored>!

	mkpath ["example/", 0];
	
	[find "example"]                  # --> ["example"]

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

=head2 find_stop ()

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")>.

=item * L<File::Path::Tiny> – C<File::Path::Tiny::rm($path)>. Does not throw exceptions.

=item * L<Mojo::File> – C<< path($file)-E<gt>remove >>.

=back

=head2 replace (&sub, @files)

Replaces each file with C<$_> if it is modified by C<&sub>. Returns files that have no replacements.

C<@files> can contain arrays of two elements. The first is considered as a path, and the second as a layer. The default layer is C<:utf8>.

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

	
	mkpath "A///./file";
	-d "A"  # -> 1

=head3 See also

=over

=item * L<File::Path> – C<mkpath("dir1/dir2")>.

=item * L<File::Path::Tiny> – C<File::Path::Tiny::mk($path)>. Does not throw exceptions.

=back

=head2 mtime (;$path)

Modification time of C<$path> in unixtime with fractional part (from C<Time::HiRes::stat>). Without a parameter, uses C<$_>.

Throws an exception if the file does not exist or does not have permission:

	local $_ = "nofile";



( run in 0.592 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )