diff options
Diffstat (limited to 'source/OSSupport/File.cpp')
-rw-r--r-- | source/OSSupport/File.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/OSSupport/File.cpp b/source/OSSupport/File.cpp index cc0916711..a4c9a22f4 100644 --- a/source/OSSupport/File.cpp +++ b/source/OSSupport/File.cpp @@ -287,6 +287,21 @@ bool cFile::Rename(const AString & a_OrigFileName, const AString & a_NewFileName +bool cFile::IsFolder(const AString & a_Path) +{ + #ifdef _WIN32 + DWORD FileAttrib = GetFileAttributes(a_Path.c_str()); + return ((FileAttrib != INVALID_FILE_ATTRIBUTES) && ((FileAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0)); + #else + struct stat st; + return ((stat(a_Path.c_str(), &st) == 0) && S_ISDIR(st.st_mode)); + #endif +} + + + + + int cFile::Printf(const char * a_Fmt, ...) { AString buf; |