SPVM::Sys::FileTest - File Tests
use Sys::FileTest; my $file = "foo.txt"; if (Sys::FileTest->e($file)) } if (Sys::FileTest->f($file)) } if (Sys::FileTest->d($file)) }
Sys::FileTest is the class for file tests.
Sys::FileTest
static method o : int ($file : string)
File is owned by effective uid.
static method R : int ($file : string)
File is readable by real uid/gid.
static method W : int ($file : string)
File is writable by real uid/gid.
static method X : int ($file : string)
File is executable by real uid/gid.
static method O : int ($file : string)
File is owned by real uid.
static method e : int ($file : string)
File exists.
static method z : int ($file : string)
File has zero size (is empty).
static method s : long ($file : string)
File has nonzero size (returns size in bytes).
static method f : int ($file : string)
File is a plain file.
static method d : int ($file : string)
File is a directory.
static method l : int ($file : string)
File is a symbolic link (false if symlinks aren't supported by the file system).
static method p : int ($file : string)
File is a named pipe (FIFO), or Filehandle is a pipe.
static method S : int ($file : string)
File is a socket.
static method b : int ($file : string)
File is a block special file.
static method c : int ($file : string)
File is a character special file.
static method u : int ($file : string)
File has setuid bit set.
static method g : int ($file : string)
File has setgid bit set.
static method k : int ($file : string)
File has sticky bit set.
static method M : double ($file : string, $base_time : long)
Script start time(base time) minus file modification time, in days.
static method A : double ($file : string, $base_time : long)
Script start time(base time) minus file access time, in days.
static method C : double ($file : string, $base_time : long)
Script start time(base time) minus file inode change time, in days.
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.