Aion-Fs
view release on metacpan or search on metacpan
Так же Ð¸Ð¼ÐµÐµÑ Ð¼ÐµÑод `path`, к-й возвÑаÑÐ°ÐµÑ Ð¿ÑÑÑ Ðº ÑайлÑ.
```perl
my $test_file = "test_ilay_complete.txt";
my $f = ilay $test_file;
print $f "Line 1\n";
print $f "Line 2\n";
my $std = select $f; $| = 1; select $std;
-s $f # -> 14
$f->path # => test_ilay_complete.txt
fileno($f) > 0 # -> 1
undef $f;
cat $test_file # => Line 1\nLine 2\n
local $_ = [$test_file, ':raw'];
i18n/Aion/Fs.ru-en.po view on Meta::CPAN
"* [File::Find](https://metacpan.org/pod/File::Find) â `find( sub { push @paths, $File::Find::name if /\\.png/ }, $dir )`.\n"
"* [File::Find::utf8](https://metacpan.org/pod/File::Find::utf8) â like [File::Find](https://metacpan.org/pod/File::Find), only file paths are in _utf8_.\n"
"* [File::Find::Age](https://metacpan.org/pod/File::Find::Age) â sorts files by modification time (inherits [File::Find::Rule](https://metacpan.org/pod/File::Find::Rule)): `File::Find::Age->in($dir1, $dir2)`.\n"
"* [File::Find::Declare](https://metacpan.org/pod/File::Find::Declare) â `@paths = File::Find::Declare->new({ size => '>10K', perms => 'wr-wr-wr-', modified => '<2010-01-30', recurse => 1, dirs => [$dir1] })->find`.\n"
"* [File::Find::Iterator](https://metacpan.org/pod/File::Find::Iterator) â has an OOP interface with an iterator and the `imap` and `igrep` functions.\n"
"* [File::Find::Match](https://metacpan.org/pod/File::Find::Match) â calls a handler for each matching filter. Similar to `switch`.\n"
"* [File::Find::Node](https://metacpan.org/pod/File::Find::Node) â traverses the file hierarchy in parallel by several processes: `tie @paths, IPC::Shareable, { key => \"GLUE STRING\", create => 1 }; File::Find::Node->new(\".\")->process(sub { my $...
"* [File::Find::Fast](https://metacpan.org/pod/File::Find::Fast) â `@paths = @{ find($dir) }`.\n"
"* [File::Find::Object](https://metacpan.org/pod/File::Find::Object) â has an OOP interface with an iterator.\n"
"* [File::Find::Parallel](https://metacpan.org/pod/File::Find::Parallel) â can compare two directories and return their union, intersection and quantitative intersection.\n"
"* [File::Find::Random](https://metacpan.org/pod/File::Find::Random) â selects a file or directory at random from the file hierarchy.\n"
"* [File::Find::Rex](https://metacpan.org/pod/File::Find::Rex) â `@paths = File::Find::Rex->new(recursive => 1, ignore_hidden => 1)->query($dir, qr/^b/i)`.\n"
"* [File::Find::Rule](https://metacpan.org/pod/File::Find::Rule) â `@files = File::Find::Rule->any( File::Find::Rule->file->name('*.mp3', '*.ogg')->size('>2M'), File::Find::Rule->empty )->in($dir1, $dir2);`. Has an iterator, procedural interface an...
"* [File::Find::Wanted](https://metacpan.org/pod/File::Find::Wanted) â `@paths = find_wanted( sub { -f && /\\.png/ }, $dir )`.\n"
"* [File::Hotfolder](https://metacpan.org/pod/File::Hotfolder) â `watch( $dir, callback => sub { push @paths, shift } )->loop`. Powered by `AnyEvent`. Customizable. There is parallelization into several processes.\n"
"* [File::Mirror](https://metacpan.org/pod/File::Mirror) â also forms a parallel path for copying files: `recursive { my ($src, $dst) = @_; push @paths, $src } '/path/A', '/path/B'`.\n"
"* [File::Set](https://metacpan.org/pod/File::Set) â `$fs = File::Set->new; $fs->add($dir); @paths = map { $_->[0] } $fs->get_path_list`.\n"
"* [File::Wildcard](https://metacpan.org/pod/File::Wildcard) â `$fw = File::Wildcard->new(exclude => qr/.svn/, case_insensitive => 1, sort => 1, path => \"src///*.cpp\", match => qr(^src/(.*?)\\.cpp$), derive => ['src/$1.o','src/$1.hpp']); push @pa...
"* [File::Wildcard::Find](https://metacpan.org/pod/File::Wildcard::Find) â `findbegin($dir); push @paths, $f while $f = findnext()` or `findbegin($dir); @paths = findall()`.\n"
"* [File::Util](https://metacpan.org/pod/File::Util) â `File::Util->new->list_dir($dir, qw/ --pattern=\\.txt$ --files-only --recurse /)`.\n"
"* [Mojo::File](https://metacpan.org/pod/Mojo::File) â `say for path($path)->list_tree({hidden => 1, dir => 1})->each`.\n"
lib/Aion/Fs.md view on Meta::CPAN
Так же Ð¸Ð¼ÐµÐµÑ Ð¼ÐµÑод `path`, к-й возвÑаÑÐ°ÐµÑ Ð¿ÑÑÑ Ðº ÑайлÑ.
```perl
my $test_file = "test_ilay_complete.txt";
my $f = ilay $test_file;
print $f "Line 1\n";
print $f "Line 2\n";
my $std = select $f; $| = 1; select $std;
-s $f # -> 14
$f->path # => test_ilay_complete.txt
fileno($f) > 0 # -> 1
undef $f;
cat $test_file # => Line 1\nLine 2\n
local $_ = [$test_file, ':raw'];
lib/Aion/Fs.pm view on Meta::CPAN
=item * L<File::Find::Match> â calls a handler for each matching filter. Similar to C<switch>.
=item * L<File::Find::Node> â traverses the file hierarchy in parallel by several processes: C<< tie @paths, IPC::Shareable, { key =E<gt> "GLUE STRING", create =E<gt> 1 }; File::Find::Node-E<gt>new(".")-E<gt>process(sub { my $f = shift; $f-E<gt>for...
=item * L<File::Find::Fast> â C<@paths = @{ find($dir) }>.
=item * L<File::Find::Object> â has an OOP interface with an iterator.
=item * L<File::Find::Parallel> â can compare two directories and return their union, intersection and quantitative intersection.
=item * L<File::Find::Random> â selects a file or directory at random from the file hierarchy.
=item * L<File::Find::Rex> â C<< @paths = File::Find::Rex-E<gt>new(recursive =E<gt> 1, ignore_hidden =E<gt> 1)-E<gt>query($dir, qr/^b/i) >>.
=item * L<File::Find::Rule> â C<< @files = File::Find::Rule-E<gt>any( File::Find::Rule-E<gt>file-E<gt>name('*.mp3', '*.ogg')-E<gt>size('E<gt>2M'), File::Find::Rule-E<gt>empty )-E<gt>in($dir1, $dir2); >>. Has an iterator, procedural interface and ex...
=item * L<File::Find::Wanted> â C<@paths = find_wanted( sub { -f && /\.png/ }, $dir )>.
=item * L<File::Hotfolder> â C<< watch( $dir, callback =E<gt> sub { push @paths, shift } )-E<gt>loop >>. Powered by C<AnyEvent>. Customizable. There is parallelization into several processes.
=item * L<File::Mirror> â also forms a parallel path for copying files: C<recursive { my ($src, $dst) = @_; push @paths, $src } '/path/A', '/path/B'>.
lib/Aion/Fs.pm view on Meta::CPAN
Creates a file descriptor. It knows how to close as soon as the last link to it disappears.
It also has a C<path> method, which returns the path to the file.
my $test_file = "test_ilay_complete.txt";
my $f = ilay $test_file;
print $f "Line 1\n";
print $f "Line 2\n";
my $std = select $f; $| = 1; select $std;
-s $f # -> 14
$f->path # => test_ilay_complete.txt
fileno($f) > 0 # -> 1
undef $f;
cat $test_file # => Line 1\nLine 2\n
local $_ = [$test_file, ':raw'];
lib/Aion/Fs/Lay.md view on Meta::CPAN
my $file = "lay.test.txt";
my $f = Symbol::gensym;
open $f, ">", $file or die $!;
$f = Aion::Fs::Lay->new(f => $f, path => $file);
printf $f "%s!\n", "hi";
-s $f; # -> 0
my $std = select $f; $| = 1; select $std;
-s $f; # -> 4
$f->path; # => lay.test.txt
undef $f;
```
# DESCRIPTION
СодеÑÐ¶Ð¸Ñ ÑайловÑй деÑкÑипÑоÑ, коÑоÑÑй закÑÑваеÑÑÑ Ð² деÑÑÑÑкÑоÑе. РблагодаÑÑ Ð¿ÐµÑегÑÑзке опеÑаÑоÑа `*{}` ÑабоÑÐ°ÐµÑ Ñо вÑеми ÑайловÑми опеÑÐ...
lib/Aion/Fs/Lay.pm view on Meta::CPAN
my $file = "lay.test.txt";
my $f = Symbol::gensym;
open $f, ">", $file or die $!;
$f = Aion::Fs::Lay->new(f => $f, path => $file);
printf $f "%s!\n", "hi";
-s $f; # -> 0
my $std = select $f; $| = 1; select $std;
-s $f; # -> 4
$f->path; # => lay.test.txt
undef $f;
=head1 DESCRIPTION
СодеÑÐ¶Ð¸Ñ ÑайловÑй деÑкÑипÑоÑ, коÑоÑÑй закÑÑваеÑÑÑ Ð² деÑÑÑÑкÑоÑе. РблагодаÑÑ Ð¿ÐµÑегÑÑзке опеÑаÑоÑа C<*{}> ÑабоÑÐ°ÐµÑ Ñо вÑеми ÑайловÑми опеÑ...
t/aion/fs.t view on Meta::CPAN
#
# Так же Ð¸Ð¼ÐµÐµÑ Ð¼ÐµÑод `path`, к-й возвÑаÑÐ°ÐµÑ Ð¿ÑÑÑ Ðº ÑайлÑ.
#
::done_testing; }; subtest 'ilay (;$path)' => sub {
my $test_file = "test_ilay_complete.txt";
my $f = ilay $test_file;
print $f "Line 1\n";
print $f "Line 2\n";
my $std = select $f; $| = 1; select $std;
local ($::_g0 = do {-s $f}, $::_e0 = do {14}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '-s $f # -> 14' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {$f->path}, $::_e0 = "test_ilay_complete.txt"); ::ok $::_g0 eq $::_e0, '$f->path # => test_ilay_complete.txt' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {fileno($f) > 0}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'fileno($f) > 0 # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
undef $f;
local ($::_g0 = do {cat $test_file}, $::_e0 = "Line 1\nLine 2\n"); ::ok $::_g0 eq $::_e0, 'cat $test_file # => Line 1\nLine 2\n' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local $_ = [$test_file, ':raw'];
t/aion/fs/lay.t view on Meta::CPAN
my $file = "lay.test.txt";
my $f = Symbol::gensym;
open $f, ">", $file or die $!;
$f = Aion::Fs::Lay->new(f => $f, path => $file);
printf $f "%s!\n", "hi";
local ($::_g0 = do {-s $f;}, $::_e0 = do {0}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '-s $f; # -> 0' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
my $std = select $f; $| = 1; select $std;
local ($::_g0 = do {-s $f;}, $::_e0 = do {4}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '-s $f; # -> 4' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {$f->path;}, $::_e0 = "lay.test.txt"); ::ok $::_g0 eq $::_e0, '$f->path; # => lay.test.txt' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
undef $f;
#
# # DESCRIPTION
#
# СодеÑÐ¶Ð¸Ñ ÑайловÑй деÑкÑипÑоÑ, коÑоÑÑй закÑÑваеÑÑÑ Ð² деÑÑÑÑкÑоÑе. РблагодаÑÑ Ð¿ÐµÑегÑÑзке опеÑаÑоÑа `*{}` ÑабоÑÐ°ÐµÑ Ñо вÑеми ÑайловÑми опеÑ...
( run in 1.218 second using v1.01-cache-2.11-cpan-0e6a335f810 )