]> git.lizzy.rs Git - minetest.git/blobdiff - src/filesys.cpp
Implement --debugger option to improve UX when debugging crashes (#13157)
[minetest.git] / src / filesys.cpp
index 7edb60bcd19a566a7da40c29b296282598d02a07..d610c2311b15a6dd29835d2e39a8e02ab259d5fc 100644 (file)
@@ -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 == '/';