How do I check whether a file exists without exceptions?