Error checking on fopen, file
| From: | Paul Smith | Date: | Sat, 21 Jul 2001 01:54:43 +0000 |
| Subject: | Error checking on fopen, file | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8427@lists.php.net to get a copy of this message | ||
Hi. I've written a site that works with files a lot. I want to provide
some sort of error catching so I'm thinking of putting each fopen and
file in an if statement like this:
if (fopen("file","r")) {
// do code with file
}
Should I do this for *all* calls to fopen and file? Or just some, like
ones that write or append. What's the best programming practice.
--
Paul Smith
psmith@dostuff.net
http://www.dostuff.net