From edd7363eddc9f6ef6a7f798a092500b328d5a7f3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 18 Sep 2013 18:43:03 +0200 Subject: Proper folder / file distinction in plugin loading. --- source/OSSupport/File.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/OSSupport/File.cpp') diff --git a/source/OSSupport/File.cpp b/source/OSSupport/File.cpp index cc0916711..871d9fb94 100644 --- a/source/OSSupport/File.cpp +++ b/source/OSSupport/File.cpp @@ -287,6 +287,20 @@ bool cFile::Rename(const AString & a_OrigFileName, const AString & a_NewFileName +bool cFile::IsFolder(const AString & a_Path) +{ + #ifdef _WIN32 + return ((GetFileAttributes(a_Path.c_str()) & 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; -- cgit v1.2.3