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