I came across this line of code:
if( -f ) { ... }
-f
appears to test whether the filename exists or not, but I am
In Unix, directories can contain the following types of files:
-f
tests if the provided name references a file that's a plain file. It will return undef (error ENOENT
) if the file doesn't exist, or some other false values if the file exists but it's not plain file (e.g. if it's a directory).
-X operators