The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

A

  static method A : double ($file : string)

The program starting time(CommandInfo-BASE_TIME|SPVM::CommandInfo/"BASE_TIME">) minus file access time, in days.

C

  static method C : double ($file : string)

The program starting time(CommandInfo-BASE_TIME|SPVM::CommandInfo/"BASE_TIME">) minus file inode change time, in days.

M

  static method M : double ($file : string)

The program starting time(CommandInfo-BASE_TIME|SPVM::CommandInfo/"BASE_TIME">) minus file modification time, in days.

O

  static method O : int ($file : string)

The file is owned by real uid.

R

  static method R : int ($file : string)

The file is readable by real uid/gid.

S

  static method S : int ($file : string)

The file is a socket.

W

  static method W : int ($file : string)

The file is writable by real uid/gid.

X

  static method X : int ($file : string)

The file is executable by real uid/gid.

b

  static method b : int ($file : string)

The file is a block special file.

c

  static method c : int ($file : string)

The file is a character special file.

d

  static method d : int ($file : string)

The file is a directory.

e

  static method e : int ($file : string)

The file exists.

f

  static method f : int ($file : string)

The file is a plain file.

g

  static method g : int ($file : string)

The file has setgid bit set.

k

  static method k : int ($file : string)

The file has sticky bit set.

l

  static method l : int ($file : string)

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

o

  static method o : int ($file : string)

The file is owned by effective uid.

p

  static method p : int ($file : string)

The file is a named pipe (FIFO), or Filehandle is a pipe.

r

  static method r : int ($file : string)

The file is readable by effective uid/gid.

s

  static method s : long ($file : string)

The file has nonzero size (returns size in bytes).

u

  static method u : int ($file : string)

The file has setuid bit set.

w

  static method w : int ($file : string)

The file is writable by effective uid/gid.

x

  static method x : int ($file : string)

The file is executable by effective uid/gid.

z

  static method z : int ($file : string)

The file has zero size (is empty).