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 )