The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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

o

  static method o : int ($file : string)

File is owned by effective uid.

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.

O

  static method O : int ($file : string)

File is owned by real uid.

e

  static method e : int ($file : string)

File exists.

z

  static method z : int ($file : string)

File has zero size (is empty).

s

  static method s : long ($file : string)

File has nonzero size (returns size in bytes).

f

  static method f : int ($file : string)

File is a plain file.

d

  static method d : int ($file : string)

File is a directory.

l

  static method l : int ($file : string)

File is a symbolic link (false if symlinks aren't supported by the file system).

p

  static method p : int ($file : string)

File is a named pipe (FIFO), or Filehandle is a pipe.

S

  static method S : int ($file : string)

File is a socket.

b

  static method b : int ($file : string)

File is a block special file.

c

  static method c : int ($file : string)

File is a character special file.

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.

M

  static method M : double ($file : string, $base_time : long)

Script start time(base time) minus file modification time, in days.

A

  static method A : double ($file : string, $base_time : long)

Script start time(base time) minus file access 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.