Handling Errors
entertainingcode.com
entertainingcode.com
No. The right thing to do is to try to open the file, and if you fail, check if errno == ENOENT and handle it appropriately. If you check to see if the file exists before (or after!) trying to open it, you have a race condition which is at best liable to produce screwy results and at worst a serious security flaw.
And if you're using a language which doesn't allow you to look at errno to figure out why open(2) failed... start using a real programming language.