… | |
… | |
512 | into memory. Status is the same as with aio_read. |
512 | into memory. Status is the same as with aio_read. |
513 | |
513 | |
514 | aio_copy $srcpath, $dstpath, $callback->($status) |
514 | aio_copy $srcpath, $dstpath, $callback->($status) |
515 | Try to copy the *file* (directories not supported as either source |
515 | Try to copy the *file* (directories not supported as either source |
516 | or destination) from $srcpath to $dstpath and call the callback with |
516 | or destination) from $srcpath to $dstpath and call the callback with |
517 | the 0 (error) or -1 ok. |
517 | a status of 0 (ok) or -1 (error, see $!). |
518 | |
518 | |
519 | This is a composite request that creates the destination file with |
519 | This is a composite request that creates the destination file with |
520 | mode 0200 and copies the contents of the source file into it using |
520 | mode 0200 and copies the contents of the source file into it using |
521 | "aio_sendfile", followed by restoring atime, mtime, access mode and |
521 | "aio_sendfile", followed by restoring atime, mtime, access mode and |
522 | uid/gid, in that order. |
522 | uid/gid, in that order. |
… | |
… | |
526 | uid/gid, where errors are being ignored. |
526 | uid/gid, where errors are being ignored. |
527 | |
527 | |
528 | aio_move $srcpath, $dstpath, $callback->($status) |
528 | aio_move $srcpath, $dstpath, $callback->($status) |
529 | Try to move the *file* (directories not supported as either source |
529 | Try to move the *file* (directories not supported as either source |
530 | or destination) from $srcpath to $dstpath and call the callback with |
530 | or destination) from $srcpath to $dstpath and call the callback with |
531 | the 0 (error) or -1 ok. |
531 | a status of 0 (ok) or -1 (error, see $!). |
532 | |
532 | |
533 | This is a composite request that tries to rename(2) the file first; |
533 | This is a composite request that tries to rename(2) the file first; |
534 | if rename fails with "EXDEV", it copies the file with "aio_copy" |
534 | if rename fails with "EXDEV", it copies the file with "aio_copy" |
535 | and, if that is successful, unlinks the $srcpath. |
535 | and, if that is successful, unlinks the $srcpath. |
536 | |
536 | |