5 #ifndef ICE_FILE_UTIL_H
6 #define ICE_FILE_UTIL_H
16 namespace IceUtilInternal
19 extern const ICE_API std::string pathsep;
20 extern const ICE_API std::string separator;
25 ICE_API bool isAbsolutePath(
const std::string&);
30 ICE_API bool fileExists(
const std::string&);
35 ICE_API bool directoryExists(
const std::string&);
40 ICE_API bool isEmptyDirectory(
const std::string&);
44 #if defined(__MINGW32__)
45 typedef struct _stat structstat;
47 typedef struct _stat64i32 structstat;
52 # define O_RDONLY _O_RDONLY
56 # define O_BINARY _O_BINARY
60 # define S_ISDIR(mode) ((mode) & _S_IFDIR)
64 # define S_ISREG(mode) ((mode) & _S_IFREG)
70 typedef struct stat structstat;
78 ICE_API int stat(
const std::string&, structstat*);
79 ICE_API int remove(
const std::string&);
80 ICE_API int rename(
const std::string&,
const std::string&);
81 ICE_API int rmdir(
const std::string&);
83 ICE_API int mkdir(
const std::string&,
int);
84 ICE_API FILE* fopen(
const std::string&,
const std::string&);
85 ICE_API FILE* freopen(
const std::string&,
const std::string&, FILE*);
86 ICE_API int open(
const std::string&,
int);
87 ICE_API int getcwd(std::string&);
89 ICE_API int unlink(
const std::string&);
107 FileLock(
const std::string&);
130 #if defined(_WIN32) && !defined(__MINGW32__)
131 ICE_API std::wstring streamFilename(
const std::string&);
133 inline std::string streamFilename(
const std::string& filename)