From 87d509e4625df2d76a80f14cab3d420bd58ba20a Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 23 Jan 2023 00:19:30 +0100 Subject: Implement --debugger option to improve UX when debugging crashes (#13157) --- src/filesys.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/filesys.cpp') 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 == '/'; -- cgit v1.2.3