--- IO-AIO/AIO.pm 2012/12/17 06:18:39 1.240 +++ IO-AIO/AIO.pm 2014/07/30 22:00:04 1.249 @@ -70,7 +70,6 @@ This is a simple example that uses the EV module and loads F asynchronously: - use Fcntl; use EV; use IO::AIO; @@ -170,7 +169,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = '4.18'; + our $VERSION = 4.31; our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx @@ -230,7 +229,7 @@ aio_link $srcpath, $dstpath, $callback->($status) aio_symlink $srcpath, $dstpath, $callback->($status) aio_readlink $pathname, $callback->($link) - aio_realpath $pathname, $callback->($link) + aio_realpath $pathname, $callback->($path) aio_rename $srcpath, $dstpath, $callback->($status) aio_mkdir $pathname, $mode, $callback->($status) aio_rmdir $pathname, $callback->($status) @@ -605,8 +604,8 @@ fsid => 1810 } -Here is a (likely partial) list of fsid values used by Linux - it is safe -to hardcode these when the $^O is C: +Here is a (likely partial - send me updates!) list of fsid values used by +Linux - it is safe to hardcode these when C<$^O> is C: 0x0000adf5 adfs 0x0000adff affs @@ -725,8 +724,8 @@ =item aio_allocate $fh, $mode, $offset, $len, $callback->($status) -Allocates or freed disk space according to the C<$mode> argument. See the -linux C docuemntation for details. +Allocates or frees disk space according to the C<$mode> argument. See the +linux C documentation for details. C<$mode> can currently be C<0> or C to allocate space, or C to C<$dstpath>, just as rename(2) and call the callback with the result code. +On systems that support the AIO::WD working directory abstraction +natively, the case C<[$wd, "."]> as C<$srcpath> is specialcased - instead +of failing, C is called on the absolute path of C<$wd>. + =item aio_mkdir $pathname, $mode, $callback->($status) @@ -810,6 +813,10 @@ Asynchronously rmdir (delete) a directory and call the callback with the result code. +On systems that support the AIO::WD working directory abstraction +natively, the case C<[$wd, "."]> is specialcased - instead of failing, +C is called on the absolute path of C<$wd>. + =item aio_readdir $pathname, $callback->($entries) @@ -1550,9 +1557,6 @@ C callback, as future requests using the value will fail in the expected way. -If this call isn't available because your OS lacks it or it couldn't be -detected, it will be emulated by calling C instead. - =item IO::AIO::CWD This is a compiletime constant (object) that represents the process @@ -1574,6 +1578,8 @@ warn "path is $_[0]\n"; }; +Currently, C always, and C and C +sometimes, fall back to using an absolue path. =head2 IO::AIO::REQ CLASS @@ -1927,7 +1933,7 @@ blocks, and a bad way to reduce concurrency because it is inexact: Better use an C together with a feed callback. -It's main use is in scripts without an event loop - when you want to stat +Its main use is in scripts without an event loop - when you want to stat a lot of files, you can write somehting like this: IO::AIO::max_outstanding 32; @@ -1977,8 +1983,10 @@ =head3 MISCELLANEOUS FUNCTIONS -IO::AIO implements some functions that might be useful, but are not -asynchronous. +IO::AIO implements some functions that are useful when you want to use +some "Advanced I/O" function not available to in Perl, without going the +"Asynchronous I/O" route. Many of these have an asynchronous C +counterpart. =over 4 @@ -2106,9 +2114,16 @@ =item IO::AIO::tee $r_fh, $w_fh, $length, $flags -Calls the GNU/Linux C syscall, see it's manpage and the +Calls the GNU/Linux C syscall, see its manpage and the description for C above for details. +=item $actual_size = IO::AIO::pipesize $r_fh[, $new_size] + +Attempts to query or change the pipe buffer size. Obviously works only +on pipes, and currently works only on GNU/Linux systems, and fails with +C<-1>/C everywhere else. If anybody knows how to influence pipe buffer +size on other systems, drop me a note. + =back =cut