If you don't want to open a file to check if it exists, there is a bunch of test operators you can use. Here's a quick summary of the most common:<br><br>-e Does the file exist?<br>-z Is the file zero length?<br>-s Is the file non-zero length?<br>-r Can I read the file?<br>-w Can I write to the file?<br>-x Can I execute the file?<br>-f Is it a standard file?<br>-d Is it a directory?<br>-T Is it a text file?<br>-B Is it a binary file?<br><br>Most of these imply the "-e" test. For example, if you can read a file, then it must exist. Here's a quick example that checks if we can execute a file and if it is a binary file.<br><FONT FACE=monospace><br>#!/usr/bin/perl<br><br>$My_File = "/usr/bin/perl";<br><br>if ( -B $My_File && -x $My_File ) {<br> print $My_File, " is an executable binary.\n";<br>}<br></font><br>Hope that helps. <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits