How can we check if a file Exists or not using a Win32 program? I am working for a Windows Mobile App.
Another more generic non-windows way:
static bool FileExists(const char *path) { FILE *fp; fpos_t fsize = 0; if ( !fopen_s(&fp, path, "r") ) { fseek(fp, 0, SEEK_END); fgetpos(fp, &fsize); fclose(fp); } return fsize > 0; }