APR::Finfo - Perl API for APR fileinfo structure |
stat
pool
valid
protection
filetype
user
group
inode
device
nlink
size
csize
atime
mtime
ctime
fname
name
APR::Finfo - Perl API for APR fileinfo structure
XXX: Besides working through the doc we need to get good constant names from libapr (needs apr patching)
use APR::Finfo ();
META: to be completed
APR fileinfo structure provides somewhat similar information to Perl's
stat()
call, but you will want to use this module's API to query an
already stat()'ed
filehandle to avoid an extra system call or to
query attributes specific to APR file handles.
During the HTTP request handlers coming after
PerlMapToStorageHandler|docs::2.0::user::handlers::http/PerlMapToStorageHandler
,
$r->finfo|docs::2.0::api::Apache::RequestRec/C_finfo_
already contains the cached values from the apr's stat()
call. So
you don't want to perform it again, but instead get the ARP::Finfo
object via:
my $finfo = $r->finfo;
APR::Finfo
provides the following functions and/or methods:
stat
Get the specified file's stats. The file is specified by filename, instead of using a pre-opened file.
$finfo = stat($fname, $wanted_fields, $pool);
$fname
( string )stat()
.
$wanted
( string )XXX
$pool
( integer )$finfo
( APR::Finfo|docs::2.0::api::APR::Finfo
)
pool
META: Autogenerated - needs to be reviewed/completed
Allocates memory and closes lingering handles in the specified pool
$ret = $obj->pool($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( APR::Pool|docs::2.0::api::APR::Pool
)
valid
META: Autogenerated - needs to be reviewed/completed
The bitmask describing valid fields of this apr_finfo_t structure including all available 'wanted' fields and potentially more
$ret = $obj->valid($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
protection
META: Autogenerated - needs to be reviewed/completed
The access permissions of the file. Mimics Unix access rights.
$ret = $obj->protection($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
filetype
META: Autogenerated - needs to be reviewed/completed
The type of file. One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK or APR_SOCK. If the type is undetermined, the value is APR_NOFILE. If the type cannot be determined, the value is APR_UNKFILE.
$ret = $obj->filetype($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
user
META: Autogenerated - needs to be reviewed/completed
The user id that owns the file
$ret = $obj->user($newval);
Note that this method may not be meaningful on all platforms, most notably Win32.
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
group
META: Autogenerated - needs to be reviewed/completed
The group id that owns the file
$ret = $obj->group($newval);
Note that this method may not be meaningful on all platforms, most notably Win32. Incorrect results have also been reported on some versions of OSX.
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
inode
META: Autogenerated - needs to be reviewed/completed
The inode of the file.
$ret = $obj->inode($newval);
Note that this method may not be meaningful on all platforms, most notably Win32.
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
device
META: Autogenerated - needs to be reviewed/completed
The id of the device the file is on.
$ret = $obj->device($newval);
Note that this method may not be meaningful on all platforms, most notably Win32.
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
(number)
nlink
META: Autogenerated - needs to be reviewed/completed
The number of hard links to the file.
$ret = $obj->nlink($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
size
META: Autogenerated - needs to be reviewed/completed
The size of the file
$ret = $obj->size($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
csize
META: Autogenerated - needs to be reviewed/completed
The storage size consumed by the file
$ret = $obj->csize($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( integer )
atime
META: Autogenerated - needs to be reviewed/completed
The time the file was last accessed
$ret = $obj->atime($newval);
Note that this method may not be reliable on all platforms, most notably Win32 - FAT32 filesystems appear to work properly but NTFS filesystems do not.
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
(number)
mtime
META: Autogenerated - needs to be reviewed/completed
The time the file was last modified
$ret = $obj->mtime($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
(number)
ctime
META: Autogenerated - needs to be reviewed/completed
The time the file was last changed
$ret = $obj->ctime($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
(number)
fname
META: Autogenerated - needs to be reviewed/completed
The pathname of the file (possibly unrooted)
$ret = $obj->fname($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( string )
name
META: Autogenerated - needs to be reviewed/completed
The file's name (no path) in filesystem case
$ret = $obj->name($newval);
$obj
( APR::Finfo|docs::2.0::api::APR::Finfo
)$newval
( string )
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
The mod_perl development team and numerous contributors.
APR::Finfo - Perl API for APR fileinfo structure |