00001 #ifndef Impala_Basis_FileExists_h 00002 #define Impala_Basis_FileExists_h 00003 00004 #include <cstdio> 00005 #include "Basis/String.h" 00006 00007 namespace Impala 00008 { 00009 00010 00011 inline bool 00012 FileExists(const String& fileName) 00013 { 00014 FILE* fp = fopen(fileName.c_str(), "r"); 00015 bool exists = (fp != 0); 00016 if (fp) 00017 fclose(fp); 00018 return exists; 00019 } 00020 00021 00022 } // namespace Impala 00023 00024 #endif