If you create a file_exists() function based on open/close success, it may not work correctly if the file exests, but you dont have read access rights.