… | |
… | |
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 |
202 | aio_rename aio_link aio_move aio_copy aio_group |
202 | aio_rename aio_link aio_move aio_copy aio_group |
203 | aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown |
203 | aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown |
204 | aio_chmod aio_utime aio_truncate |
204 | aio_chmod aio_utime aio_truncate |
205 | aio_msync aio_mtouch); |
205 | aio_msync aio_mtouch aio_statvfs); |
206 | |
206 | |
207 | our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); |
207 | our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); |
208 | our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush |
208 | our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush |
209 | min_parallel max_parallel max_idle |
209 | min_parallel max_parallel max_idle |
210 | nreqs nready npending nthreads |
210 | nreqs nready npending nthreads |
… | |
… | |
430 | |
430 | |
431 | aio_stat "/etc/passwd", sub { |
431 | aio_stat "/etc/passwd", sub { |
432 | $_[0] and die "stat failed: $!"; |
432 | $_[0] and die "stat failed: $!"; |
433 | print "size is ", -s _, "\n"; |
433 | print "size is ", -s _, "\n"; |
434 | }; |
434 | }; |
|
|
435 | |
|
|
436 | |
|
|
437 | =item aio_statvfs $fh_or_path, $callback->($statvfs) |
|
|
438 | |
|
|
439 | Works like the POSIX C<statvfs> or C<fstatvfs> syscalls, depending on |
|
|
440 | whether a file handle or path was passed. |
|
|
441 | |
|
|
442 | On success, the callback is passed a hash reference with the following |
|
|
443 | members: C<bsize>, C<frsize>, C<blocks>, C<bfree>, C<bavail>, C<files>, |
|
|
444 | C<ffree>, C<favail>, C<fsid>, C<flag> and C<namemax>. On failure, C<undef> |
|
|
445 | is passed. |
|
|
446 | |
|
|
447 | The following POSIX IO::AIO::ST_* constants are defined: C<ST_RDONLY> and |
|
|
448 | C<ST_NOSUID>. |
|
|
449 | |
|
|
450 | The following non-POSIX IO::AIO::ST_* flag masks are defined to |
|
|
451 | their correct value when available, or to C<0> on systems that do |
|
|
452 | not support them: C<ST_NODEV>, C<ST_NOEXEC>, C<ST_SYNCHRONOUS>, |
|
|
453 | C<ST_MANDLOCK>, C<ST_WRITE>, C<ST_APPEND>, C<ST_IMMUTABLE>, C<ST_NOATIME>, |
|
|
454 | C<ST_NODIRATIME> and C<ST_RELATIME>. |
|
|
455 | |
|
|
456 | Example: stat C</wd> and dump out the data if successful. |
|
|
457 | |
|
|
458 | aio_statvfs "/wd", sub { |
|
|
459 | my $f = $_[0] |
|
|
460 | or die "statvfs: $!"; |
|
|
461 | |
|
|
462 | use Data::Dumper; |
|
|
463 | say Dumper $f; |
|
|
464 | }; |
|
|
465 | |
|
|
466 | # result: |
|
|
467 | { |
|
|
468 | bsize => 1024, |
|
|
469 | bfree => 4333064312, |
|
|
470 | blocks => 10253828096, |
|
|
471 | files => 2050765568, |
|
|
472 | flag => 4096, |
|
|
473 | favail => 2042092649, |
|
|
474 | bavail => 4333064312, |
|
|
475 | ffree => 2042092649, |
|
|
476 | namemax => 255, |
|
|
477 | frsize => 1024, |
|
|
478 | fsid => 1810 |
|
|
479 | } |
435 | |
480 | |
436 | |
481 | |
437 | =item aio_utime $fh_or_path, $atime, $mtime, $callback->($status) |
482 | =item aio_utime $fh_or_path, $atime, $mtime, $callback->($status) |
438 | |
483 | |
439 | Works like perl's C<utime> function (including the special case of $atime |
484 | Works like perl's C<utime> function (including the special case of $atime |