We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6735660 commit 14f4441Copy full SHA for 14f4441
Sources/Foundation/FileManager+Win32.swift
@@ -709,9 +709,10 @@ extension FileManager {
709
}
710
711
internal func _isExecutableFile(atPath path: String) -> Bool {
712
- var isDirectory: ObjCBool = false
713
- guard fileExists(atPath: path, isDirectory: &isDirectory) else { return false }
714
- guard !isDirectory.boolValue, _isReadableFile(atPath: path) else { return false }
+ guard let faAttributes: WIN32_FILE_ATTRIBUTE_DATA = try? windowsFileAttributes(atPath: path),
+ faAttributes.dwFileAttributes & DWORD(FILE_ATTRIBUTE_DIRECTORY) != DWORD(FILE_ATTRIBUTE_DIRECTORY) else {
+ return false
715
+ }
716
return path.withCString(encodedAs: UTF16.self) {
717
var binaryType = DWORD(0)
718
return GetBinaryTypeW($0, &binaryType)
0 commit comments