Skip to content

Commit 9cd3a53

Browse files
authored
[Windows] Now FileManager.isExecutableFile(atPath:) checks if the file exists and is readable
1 parent 142d88b commit 9cd3a53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Foundation/FileManager+Win32.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ extension FileManager {
497497
}
498498

499499
internal func _isExecutableFile(atPath path: String) -> Bool {
500-
// FIXME(compnerd) is there some test that we can perform here?
501-
return true
500+
var isDirectory: ObjCBool = false
501+
guard fileExists(atPath: path, isDirectory: &isDirectory) else { return false }
502+
return !isDirectory.boolValue && _isReadableFile(atPath: path)
502503
}
503504

504505
internal func _isDeletableFile(atPath path: String) -> Bool {

0 commit comments

Comments
 (0)