bool fileExists(const UnicodeString& path) { struct _stat s; if (statPath(path, &s)) { return _S_ISREG(s.st_mode); } else { return false; } }
PathType pathType(const UnicodeString& path) { struct _stat s; if (statPath(path, &s)) { return _S_ISREG(s.st_mode) ? PATHTYPE_FILE : (_S_ISDIR(s.st_mode) ? PATHTYPE_DIR : PATHTYPE_NONE); } else { return PATHTYPE_NONE; } }
bool dir::isFile(const char *fileName) { struct _stat buff; if (_stat(fileName, &buff) != 0) return false; #ifdef S_ISREG return S_ISREG(buff.st_mode); #else return _S_ISREG(buff.st_mode); #endif }