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.161 by root, Tue Jul 14 00:32:27 2009 UTC vs.
Revision 1.165 by root, Tue Aug 18 04:05:00 2009 UTC

191use common::sense; 191use common::sense;
192 192
193use base 'Exporter'; 193use base 'Exporter';
194 194
195BEGIN { 195BEGIN {
196 our $VERSION = '3.261'; 196 our $VERSION = '3.3';
197 197
198 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close 198 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close
199 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx 199 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
200 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync 200 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync
201 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead 201 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead
634 634
635=item aio_copy $srcpath, $dstpath, $callback->($status) 635=item aio_copy $srcpath, $dstpath, $callback->($status)
636 636
637Try to copy the I<file> (directories not supported as either source or 637Try to copy the I<file> (directories not supported as either source or
638destination) from C<$srcpath> to C<$dstpath> and call the callback with 638destination) from C<$srcpath> to C<$dstpath> and call the callback with
639the C<0> (error) or C<-1> ok. 639a status of C<0> (ok) or C<-1> (error, see C<$!>).
640 640
641This is a composite request that creates the destination file with 641This is a composite request that creates the destination file with
642mode 0200 and copies the contents of the source file into it using 642mode 0200 and copies the contents of the source file into it using
643C<aio_sendfile>, followed by restoring atime, mtime, access mode and 643C<aio_sendfile>, followed by restoring atime, mtime, access mode and
644uid/gid, in that order. 644uid/gid, in that order.
713 713
714=item aio_move $srcpath, $dstpath, $callback->($status) 714=item aio_move $srcpath, $dstpath, $callback->($status)
715 715
716Try to move the I<file> (directories not supported as either source or 716Try to move the I<file> (directories not supported as either source or
717destination) from C<$srcpath> to C<$dstpath> and call the callback with 717destination) from C<$srcpath> to C<$dstpath> and call the callback with
718the C<0> (error) or C<-1> ok. 718a status of C<0> (ok) or C<-1> (error, see C<$!>).
719 719
720This is a composite request that tries to rename(2) the file first; if 720This is a composite request that tries to rename(2) the file first; if
721rename fails with C<EXDEV>, it copies the file with C<aio_copy> and, if 721rename fails with C<EXDEV>, it copies the file with C<aio_copy> and, if
722that is successful, unlinks the C<$srcpath>. 722that is successful, unlinks the C<$srcpath>.
723 723
957(E.g. rename). This might not work on all operating systems or have any 957(E.g. rename). This might not work on all operating systems or have any
958specific effect, but usually it makes sure that directory changes get 958specific effect, but usually it makes sure that directory changes get
959written to disc. It works for anything that can be opened for read-only, 959written to disc. It works for anything that can be opened for read-only,
960not just directories. 960not just directories.
961 961
962Future versions of this function might fall back to other methods when
963C<fsync> on the directory fails (such as calling C<sync>).
964
962Passes C<0> when everything went ok, and C<-1> on error. 965Passes C<0> when everything went ok, and C<-1> on error.
963 966
964=cut 967=cut
965 968
966sub aio_pathsync($;$) { 969sub aio_pathsync($;$) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines