in reply to Is any any script checking File Existance
You can use any of these to test for the presence of a file, depending on your exact requirements. For example:-e File exists. -z File has zero size (is empty). -s File has nonzero size (returns size in bytes). -f File is a plain file. -d File is a directory. -T File is an ASCII text file. -B File is a "binary" file (opposite of -T).
They look odd, I know, functions that start with dashes are a teeny bit unusual, but then again, regular expressions are far stranger.if (-f $my_file) { print "Thanks for not deleting my config file $my_file\n"; } if (-B $my_file || -z $my_file) { print "I'll bet you think you're funny.\n"; }
|
|---|