>
>Subject: Test a File If it exists
>Is there a way to test if a specific file exists or not in PERL coding?
>
>
>Regards,
>
>Sam
The "-e" command perhaps:
if ( -e "$temp_dir/$input_file" ) {
...
man perlfunc
and then " Functions for filehandles, files, or directories"
which has a section on -X:
-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.
-l File is a symbolic link.
-p File is a named pipe (FIFO), or Filehandle is a pipe.
-S File is a socket.
-b File is a block special file.
-c File is a character special file.
-t Filehandle is opened to a tty.
HTH
Greg Williamson
DBA
GlobeXplorer LLC
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs