diff options
author | Jose <jose@zeroc.com> | 2009-07-29 21:50:06 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-07-29 21:50:06 +0200 |
commit | db9adf0e14f01d0aa8eb288a172995847c006f57 (patch) | |
tree | 9690b02e0f0c85377c0feedb18b3a203d73928fb /cpp/include/IceUtil/FileUtil.h | |
parent | bug 4003 - update bindist READMEs for bzip2 (diff) | |
download | ice-db9adf0e14f01d0aa8eb288a172995847c006f57.tar.bz2 ice-db9adf0e14f01d0aa8eb288a172995847c006f57.tar.xz ice-db9adf0e14f01d0aa8eb288a172995847c006f57.zip |
Changes for bug 3962 and 4714
Diffstat (limited to 'cpp/include/IceUtil/FileUtil.h')
-rw-r--r-- | cpp/include/IceUtil/FileUtil.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/FileUtil.h b/cpp/include/IceUtil/FileUtil.h index d081a6a5cba..f68ec32ce03 100644 --- a/cpp/include/IceUtil/FileUtil.h +++ b/cpp/include/IceUtil/FileUtil.h @@ -11,6 +11,7 @@ #define ICE_FILE_UTIL_H #include <IceUtil/Config.h> +#include <sys/stat.h> namespace IceUtilInternal { @@ -20,6 +21,39 @@ namespace IceUtilInternal // ICE_UTIL_API bool isAbsolutePath(const std::string&); +// +// Determine if a file exists. +// +ICE_UTIL_API bool fileExists(const std::string&); + +// +// Determine if a directory exists. +// +ICE_UTIL_API bool directoryExists(const std::string&); + +#ifdef _WIN32 + +typedef struct _stat64i32 structstat; +#ifdef _MSC_VER +# define O_RDONLY _O_RDONLY +# define O_BINARY _O_BINARY + +# define S_ISDIR(mode) ((mode) & _S_IFDIR) +# define S_ISREG(mode) ((mode) & _S_IFREG) +#endif + +#else + +typedef struct stat structstat; +# define O_BINARY 0 + +#endif + +// +// OS stat +// +ICE_UTIL_API int stat(const std::string&, structstat*); + }; #endif |