… | |
… | |
465 | aio_move $srcpath, $dstpath, $callback->($status) |
465 | aio_move $srcpath, $dstpath, $callback->($status) |
466 | Try to move the *file* (directories not supported as either source |
466 | Try to move the *file* (directories not supported as either source |
467 | or destination) from $srcpath to $dstpath and call the callback with |
467 | or destination) from $srcpath to $dstpath and call the callback with |
468 | the 0 (error) or -1 ok. |
468 | the 0 (error) or -1 ok. |
469 | |
469 | |
470 | This is a composite request that tries to rename(2) the file first. |
470 | This is a composite request that tries to rename(2) the file first; |
471 | If rename files with "EXDEV", it copies the file with "aio_copy" |
471 | if rename fails with "EXDEV", it copies the file with "aio_copy" |
472 | and, if that is successful, unlinking the $srcpath. |
472 | and, if that is successful, unlinks the $srcpath. |
473 | |
473 | |
474 | aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) |
474 | aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) |
475 | Scans a directory (similar to "aio_readdir") but additionally tries |
475 | Scans a directory (similar to "aio_readdir") but additionally tries |
476 | to efficiently separate the entries of directory $path into two sets |
476 | to efficiently separate the entries of directory $path into two sets |
477 | of names, directories you can recurse into (directories), and ones |
477 | of names, directories you can recurse into (directories), and ones |
… | |
… | |
542 | callback with the fdatasync result code. |
542 | callback with the fdatasync result code. |
543 | |
543 | |
544 | If this call isn't available because your OS lacks it or it couldn't |
544 | If this call isn't available because your OS lacks it or it couldn't |
545 | be detected, it will be emulated by calling "fsync" instead. |
545 | be detected, it will be emulated by calling "fsync" instead. |
546 | |
546 | |
|
|
547 | aio_sync_file_range $fh, $offset, $nbytes, $flags, $callback->($status) |
|
|
548 | Sync the data portion of the file specified by $offset and $length |
|
|
549 | to disk (but NOT the metadata), by calling the Linux-specific |
|
|
550 | sync_file_range call. If sync_file_range is not available or it |
|
|
551 | returns ENOSYS, then fdatasync or fsync is being substituted. |
|
|
552 | |
|
|
553 | $flags can be a combination of |
|
|
554 | "IO::AIO::SYNC_FILE_RANGE_WAIT_BEFORE", |
|
|
555 | "IO::AIO::SYNC_FILE_RANGE_WRITE" and |
|
|
556 | "IO::AIO::SYNC_FILE_RANGE_WAIT_AFTER": refer to the sync_file_range |
|
|
557 | manpage for details. |
|
|
558 | |
547 | aio_pathsync $path, $callback->($status) |
559 | aio_pathsync $path, $callback->($status) |
548 | This request tries to open, fsync and close the given path. This is |
560 | This request tries to open, fsync and close the given path. This is |
549 | a composite request intended to sync directories after directory |
561 | a composite request intended to sync directories after directory |
550 | operations (E.g. rename). This might not work on all operating |
562 | operations (E.g. rename). This might not work on all operating |
551 | systems or have any specific effect, but usually it makes sure that |
563 | systems or have any specific effect, but usually it makes sure that |
… | |
… | |
715 | does not impose any limits). |
727 | does not impose any limits). |
716 | |
728 | |
717 | If the feed does not queue more requests when called, it will be |
729 | If the feed does not queue more requests when called, it will be |
718 | automatically removed from the group. |
730 | automatically removed from the group. |
719 | |
731 | |
720 | If the feed limit is 0, it will be set to 2 automatically. |
732 | If the feed limit is 0 when this method is called, it will be set to |
|
|
733 | 2 automatically. |
721 | |
734 | |
722 | Example: |
735 | Example: |
723 | |
736 | |
724 | # stat all files in @files, but only ever use four aio requests concurrently: |
737 | # stat all files in @files, but only ever use four aio requests concurrently: |
725 | |
738 | |
… | |
… | |
735 | limit $grp $num |
748 | limit $grp $num |
736 | Sets the feeder limit for the group: The feeder will be called |
749 | Sets the feeder limit for the group: The feeder will be called |
737 | whenever the group contains less than this many requests. |
750 | whenever the group contains less than this many requests. |
738 | |
751 | |
739 | Setting the limit to 0 will pause the feeding process. |
752 | Setting the limit to 0 will pause the feeding process. |
|
|
753 | |
|
|
754 | The default value for the limit is 0, but note that setting a feeder |
|
|
755 | automatically bumps it up to 2. |
740 | |
756 | |
741 | SUPPORT FUNCTIONS |
757 | SUPPORT FUNCTIONS |
742 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
758 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
743 | $fileno = IO::AIO::poll_fileno |
759 | $fileno = IO::AIO::poll_fileno |
744 | Return the *request result pipe file descriptor*. This filehandle |
760 | Return the *request result pipe file descriptor*. This filehandle |