ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.74 by root, Tue Oct 24 17:22:17 2006 UTC vs.
Revision 1.76 by root, Wed Oct 25 08:20:14 2006 UTC

426with the filenames. 426with the filenames.
427 427
428=item aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) 428=item aio_scandir $path, $maxreq, $callback->($dirs, $nondirs)
429 429
430Scans a directory (similar to C<aio_readdir>) but additionally tries to 430Scans a directory (similar to C<aio_readdir>) but additionally tries to
431separate the entries of directory C<$path> into two sets of names, ones 431efficiently separate the entries of directory C<$path> into two sets of
432you can recurse into (directories or links to them), and ones you cannot 432names, directories you can recurse into (directories), and ones you cannot
433recurse into (everything else). 433recurse into (everything else, including symlinks to directories).
434 434
435C<aio_scandir> is a composite request that creates of many sub requests_ 435C<aio_scandir> is a composite request that creates of many sub requests_
436C<$maxreq> specifies the maximum number of outstanding aio requests that 436C<$maxreq> specifies the maximum number of outstanding aio requests that
437this function generates. If it is C<< <= 0 >>, then a suitable default 437this function generates. If it is C<< <= 0 >>, then a suitable default
438will be chosen (currently 6). 438will be chosen (currently 6).
538 # need to check for real directory 538 # need to check for real directory
539 add $statgrp aio_lstat "$path/$entry", sub { 539 add $statgrp aio_lstat "$path/$entry", sub {
540 if (-d _) { 540 if (-d _) {
541 push @dirs, $entry; 541 push @dirs, $entry;
542 542
543 if (!--$ndirs) { 543 unless (--$ndirs) {
544 push @nondirs, @$entries; 544 push @nondirs, @$entries;
545 $statgrp->cancel_subs; 545 feed $statgrp;
546 } 546 }
547 } else { 547 } else {
548 push @nondirs, $entry; 548 push @nondirs, $entry;
549 } 549 }
550 } 550 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines