Some -X File Tests : file test « File « Perl






Some -X File Tests

    

-e        File or directory exists.

-z        File is empty (zero size).

-s        File is not empty; function returns size in bytes.

-f        Argument is a plain file.

-d        Argument is a directory.

-l        Argument is a symbolic link.

-p        Argument is a named pipe.

-S        Argument is a socket.

-b        File is a block special file.

-c        File is a character special file.

-t        Filehandle is an open tty (isatty()).

-f        Argument is readable by effective uid/gid.

-w        Argument is writable by effective uid/gid.

-x        Argument is executable by effective uid/gid.

-o        Argument is owned by effective uid.

-R        Argument is readable by real uid/gid.

-W        File is writable by real uid/gid.

-X        File is executable by real uid/gid.

-O        File is owned by real uid.

-T        File is an ASCII text file.

-B        File is a binary file.

-u        Argument has setuid bit set.

-g        Argument has setgid bit set.

-k        Argument has sticky bit set.

-M        Time in days from argument modification time to Perl program start time.

-A        Time in days from argument access time to Perl program start time.

-C        Time in days from argument change time to Perl program start time.

   
    
    
    
  








Related examples in the same category

1.'-B filehandle': True if file is binary.
2.'-S filehandle': True if file is a socket (uppercase S).
3.'-T filehandle': True if file is an ASCII text file.
4.'-d filehandle': True if file is a directory.
5.'-e filehandle': True if file exists.
6.'-f filehandle': True if file is a normal file.
7.'-l filehandle': True if file is a symbolic link.
8.'-p filehandle': True if file is a named pipe (FIFO).
9.'-s filehandle': Returns size if file exists and has nonzero size.
10.'-w filehandle': True if filehandle is writable.
11.'-x filehandle': True if filehandle is executable.
12.'-z filehandle': True if file exists and its size is 0.
13.is the file a executable file?
14.is the file a plain file?
15.is the file a readable file?
16.is the file a writable file?
17.Test for file attributes
18.Tests for read permission on a file.
19.Tests whether the file is empty before opening it for writing.
20.File test operators
21.File testing script
22.File-Test Operator Syntax
23.File-test operators that check information returned by stat.
24.File-test operators that test for permissions.
25.File Tests
26.File Tests for Age
27.File Tests for Execution
28.File Tests for Existence and Size
29.File Tests for Privileges
30.File Tests for Type
31.File Tests for Unix File Handle Types
32.File Test Operators[a]
33.Contents of the current directory
34.Get file modified/accessed time
35.Get the size of a file
36.does file exist?