aboutsummaryrefslogtreecommitdiff
path: root/src/filesys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r--src/filesys.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/filesys.cpp b/src/filesys.cpp
index 7edb60bcd..d610c2311 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -127,6 +127,12 @@ bool IsDir(const std::string &path)
(attr & FILE_ATTRIBUTE_DIRECTORY));
}
+bool IsExecutable(const std::string &path)
+{
+ DWORD type;
+ return GetBinaryType(path.c_str(), &type) != 0;
+}
+
bool IsDirDelimiter(char c)
{
return c == '/' || c == '\\';
@@ -309,6 +315,11 @@ bool IsDir(const std::string &path)
return ((statbuf.st_mode & S_IFDIR) == S_IFDIR);
}
+bool IsExecutable(const std::string &path)
+{
+ return access(path.c_str(), X_OK) == 0;
+}
+
bool IsDirDelimiter(char c)
{
return c == '/';