| 3075 | } |
| 3076 | |
| 3077 | bool SystemTools::FileIsExecutable(std::string const& inName) |
| 3078 | { |
| 3079 | #ifdef _WIN32 |
| 3080 | char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; |
| 3081 | std::string string_buffer; |
| 3082 | auto const name = RemoveTrailingSlashes(inName, local_buffer, string_buffer); |
| 3083 | auto const attr = |
| 3084 | GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str()); |
| 3085 | |
| 3086 | // On Windows any file that exists and is not a directory is considered |
| 3087 | // readable and therefore also executable: |
| 3088 | return attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY); |
| 3089 | #else |
| 3090 | return !FileIsDirectory(inName) && TestFileAccess(inName, TEST_FILE_EXECUTE); |
| 3091 | #endif |
| 3092 | } |
| 3093 | |
| 3094 | #if defined(_WIN32) |
| 3095 | bool SystemTools::FileIsSymlinkWithAttr(std::wstring const& path, |
nothing calls this directly
no test coverage detected