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 9966689 commit bb65125Copy full SHA for bb65125
Sources/Foundation/FileManager+Win32.swift
@@ -711,7 +711,11 @@ extension FileManager {
711
internal func _isExecutableFile(atPath path: String) -> Bool {
712
var isDirectory: ObjCBool = false
713
guard fileExists(atPath: path, isDirectory: &isDirectory) else { return false }
714
- return !isDirectory.boolValue && _isReadableFile(atPath: path)
+ guard !isDirectory.boolValue, _isReadableFile(atPath: path) else { return false }
715
+ return path.withCString(encodedAs: UTF16.self) {
716
+ var binaryType = DWORD(0)
717
+ SaferiIsExecutableFileType($0, false) || GetBinaryTypeW($0, &binaryType)
718
+ }
719
}
720
721
internal func _isDeletableFile(atPath path: String) -> Bool {
0 commit comments