Ejemplo n.º 1
0
bool fileExists(const UnicodeString& path) {
	struct _stat s;
	if (statPath(path, &s)) {
		return _S_ISREG(s.st_mode);
	} else {
		return false;
	}
}
Ejemplo n.º 2
0
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;
	}
}
Ejemplo n.º 3
0
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
}