SPVM::Sys::IO::Stat - The stat Functions and The struct stat in C language
use Sys::IO::Stat; my $file = "foo.txt"; my $stat = Sys::IO::Stat->new; Sys::IO::Stat->stat($file, $stat); my $st_mode = $stat->st_mode; my $st_size = $stat->st_size;
Sys::IO::Stat is the class for the struct stat in C language.
Sys::IO::Stat
struct stat
C language
This is a pointer class.
static method new : Sys::IO::Stat ();
Create a new Sys::IO::Stat object.
static method stat_raw : int ($path : string, $stat : Sys::IO::Stat);
The same as "stat", but even if the return value is -1, an exception will not be thrown.
-1
static method stat : int ($path : string, $stat : Sys::IO::Stat);
These functions return information about a file. No permissions are required on the file itself, but-in the case of stat() and lstat() - execute (search) permission is required on all of the directories in path that lead to the file.
stat() stats the file pointed to by path and fills in buf.
See the stat function in Linux.
The stat is Sys::IO::Stat object.
static method lstat_raw : int ($path : string, $stat : Sys::IO::Stat);
The same as "lstat", but even if the return value is -1, an exception will not be thrown.
static method lstat : int ($path : string, $stat : Sys::IO::Stat);
lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to.
See the lstat function in Linux.
static method fstat_raw : int ($fd : int, $stat : Sys::IO::Stat);
The same as "fstat", but even if the return value is -1, an exception will not be thrown.
static method fstat : int ($fd : int, $stat : Sys::IO::Stat);
fstat() is identical to stat(), except that the file to be stat-ed is specified by the file descriptor fd.
See fstat(2) - Linux man page in Linux.
The $stat is a Sys::IO::Stat object.
$stat
method DESTROY : void ();
The destructor.
method st_dev : int ();
Gets st_dev.
st_dev
method st_ino : int ();
Gets st_ino.
st_ino
method st_mode : int ();
Gets st_mode.
st_mode
method st_nlink : int ();
Gets st_nlink.
st_nlink
method st_uid : int ();
Gets st_uid.
st_uid
method st_gid : int ();
Gets st_gid.
st_gid
method st_rdev : int ();
Gets st_rdev.
st_rdev
method st_size : long ();
Gets st_size.
st_size
method st_blksize : long ();
Gets st_blksize.
st_blksize
method st_blocks : long ();
Gets st_blocks.
st_blocks
method st_mtime : long ();
Gets st_mtime.
st_mtime
method st_atime : long ();
Gets st_atime.
st_atime
method st_ctime : long ();
Gets st_ctime.
st_ctime
method st_mtim_tv_nsec : long ();
Gets st_mtim.tv_nsec.
st_mtim.tv_nsec
method st_atim_tv_nsec : long ();
Gets st_atim.tv_nsec.
st_atim.tv_nsec
method st_ctim_tv_nsec : long ();
Gets st_ctim.tv_nsec.
st_ctim.tv_nsec
Copyright 2022-2022 Yuki Kimoto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install SPVM::Sys, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM::Sys
CPAN shell
perl -MCPAN -e shell install SPVM::Sys
For more information on module installation, please visit the detailed CPAN module installation guide.