diff options
author | sfan5 <sfan5@live.de> | 2023-01-23 00:19:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-23 00:19:30 +0100 |
commit | 87d509e4625df2d76a80f14cab3d420bd58ba20a (patch) | |
tree | 8a17b87abf96312a79f49c05c7c4824766bcb39f /src/filesys.cpp | |
parent | 6f5703baf1737ca1d7dd70982e878fd83d288cdd (diff) | |
download | minetest-87d509e4625df2d76a80f14cab3d420bd58ba20a.tar.xz |
Implement --debugger option to improve UX when debugging crashes (#13157)
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r-- | src/filesys.cpp | 11 |
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 == '/'; |