示例#1
0
bool fileExists(const UnicodeString& path) {
	struct _stat s;
	if (statPath(path, &s)) {
		return _S_ISREG(s.st_mode);
	} else {
		return false;
	}
}
示例#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;
	}
}
示例#3
0
文件: u_file.cpp 项目: q66/neothyne
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
}