File Test Operators
A file test operator is a unary operator that tests a filename or a filehandle.
Operator | Meaning |
---|---|
| File is readable by effective uid/gid |
| File is writable by effective uid/gid |
| File is executable by effective uid/gid |
| File is owned by effective uid |
| File is readable by real uid/gid |
| File is writable by real uid/gid |
| File is executable by real uid/gid |
| File is owned by real uid |
| File exists |
| File has zero size |
| File has nonzero size (returns size) |
| File is a plain file |
| File is a directory |
| File is a symbolic link |
| File is a named pipe (FIFO) |
| File is a socket |
| File is a block special file |
| File is a character special file |
| Filehandle is opened to a tty |
| File has setuid bit set |
| File has setgid bit set |
| File has sticky bit set |
| File is a text file |
| File is a binary file (opposite of |
| Age of file (at startup) in days since modification |
| Age of file (at startup) in days since last access |
| Age of file (at startup) in days since inode change |
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.