--- IO-AIO/README 2012/10/11 03:20:52 1.53 +++ IO-AIO/README 2013/01/06 11:48:14 1.54 @@ -694,7 +694,7 @@ aio_realpath $pathname, $callback->($path) Asynchronously make the path absolute and resolve any symlinks in - $path. The resulting path only consists of directories (Same as + $path. The resulting path only consists of directories (same as Cwd::realpath). This request can be used to get the absolute path of the current @@ -704,6 +704,10 @@ Asynchronously rename the object at $srcpath to $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 "[$wd, "."]" as $srcpath is specialcased - + instead of failing, "rename" is called on the absolute path of $wd. + aio_mkdir $pathname, $mode, $callback->($status) Asynchronously mkdir (create) a directory and call the callback with the result code. $mode will be modified by the umask at the time the @@ -713,6 +717,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 "[$wd, "."]" is specialcased - instead of + failing, "rmdir" is called on the absolute path of $wd. + aio_readdir $pathname, $callback->($entries) Unlike the POSIX call of the same name, "aio_readdir" reads an entire directory (i.e. opendir + readdir + closedir). The entries @@ -944,7 +952,7 @@ inside the scalar. All caveats and parameters are the same as for "aio_msync", above, except for flags, which must be either 0 (which reads all pages and ensures they are instantiated) or - "IO::AIO::MT_MODIFY", which modifies the memory page s(by reading + "IO::AIO::MT_MODIFY", which modifies the memory pages (by reading and writing an octet from it, which dirties the page). aio_mlock $scalar, $offset = 0, $length = undef, $callback->($status) @@ -1155,7 +1163,7 @@ older systems. Some functions (such as realpath) will always rely on the string form of the pathname. - So this fucntionality is mainly useful to get some protection against + So this functionality is mainly useful to get some protection against "chdir", to easily get an absolute path out of a relative path for future reference, and to speed up doing many operations in the same directory (e.g. when stat'ing all files in a directory). @@ -1184,11 +1192,21 @@ Specifying this object as working directory object for a pathname is as if the pathname would be specified directly, without a directory - object, e.g., these calls are functionally identical: + object. For example, these calls are functionally identical: aio_stat "somefile", sub { ... }; aio_stat [IO::AIO::CWD, "somefile"], sub { ... }; + To recover the path associated with an IO::AIO::WD object, you can use + "aio_realpath": + + aio_realpath $wd, sub { + warn "path is $_[0]\n"; + }; + + Currently, "aio_statvfs" always, and "aio_rename" and "aio_rmdir" + sometimes, fall back to using an absolue path. + IO::AIO::REQ CLASS All non-aggregate "aio_*" functions return an object of this class when called in non-void context. @@ -1349,16 +1367,20 @@ See "poll_cb" for an example. IO::AIO::poll_cb - Process some outstanding events on the result pipe. You have to call - this regularly. Returns 0 if all events could be processed (or there - were no events to process), or -1 if it returned earlier for - whatever reason. Returns immediately when no events are outstanding. - The amount of events processed depends on the settings of - "IO::AIO::max_poll_req" and "IO::AIO::max_poll_time". - - If not all requests were processed for whatever reason, the - filehandle will still be ready when "poll_cb" returns, so normally - you don't have to do anything special to have it called later. + Process some requests that have reached the result phase (i.e. they + have been executed but the results are not yet reported). You have + to call this "regularly" to finish outstanding requests. + + Returns 0 if all events could be processed (or there were no events + to process), or -1 if it returned earlier for whatever reason. + Returns immediately when no events are outstanding. The amount of + events processed depends on the settings of "IO::AIO::max_poll_req", + "IO::AIO::max_poll_time" and "IO::AIO::max_outstanding". + + If not all requests were processed for whatever reason, the poll + file descriptor will still be ready when "poll_cb" returns, so + normally you don't have to do anything special to have it called + later. Apart from calling "IO::AIO::poll_cb" when the event filehandle becomes ready, it can be beneficial to call this function from loops @@ -1376,10 +1398,11 @@ cb => \&IO::AIO::poll_cb); IO::AIO::poll_wait - If there are any outstanding requests and none of them in the result - phase, wait till the result filehandle becomes ready for reading - (simply does a "select" on the filehandle. This is useful if you - want to synchronously wait for some requests to finish). + Wait until either at least one request is in the result phase or no + requests are outstanding anymore. + + This is useful if you want to synchronously wait for some requests + to become ready, without actually handling them. See "nreqs" for an example.