Friday, February 8, 2013

Perl File Test Operators

OperatorDescription
-A FILENAMEReturn the access age of FILENAME
-b FILENAMETests if FILENAME is a block device
-B FILENAMETests if FILENAME is a binary file. Can also be applied to a file handle!
-c FILENAMETests if FILENAME is a character device
-C FILENAMEReturn the inode change age of FILENAME
-A FILENAMEReturn the access age of FILENAME
-d FILENAMETests if FILENAME is a directory
-e FILENAMETests if FILENAME exists
-f FILENAMETests if FILENAME is a regular file, not, e.g., a directory
-g FILENAMETests if FILENAME has the setgid bit
-k FILENAMETests if FILENAME has the sticky bit
-l FILENAMETests if FILENAME is a symbolic link
-M FILENAMEReturns age of FILENAME
-o FILENAMETests if FILENAME is owned by the current UID
-p FILENAMETests if FILENAME is a named pipe
-r FILENAMETests if FILENAME is readable
-s FILENAMEReturns size of FILENAME
-S FILENAMETests if FILENAME is a socket
-t FILENAMETests if FILENAME is opened to a tty
-T FILENAMETests if FILENAME is a text file
-u FILENAMETests if FILENAME has the setuid bit
-w FILENAMETests if FILENAME is writable
-x FILENAMETests if FILENAME is executable
-S FILENAMETests if FILENAME is a socket
-z FILENAMETests if size of FILENAME is zero

1 comment: