swift-foundation
swift-foundation copied to clipboard
Windows produces different error codes for empty paths compared to Linux/Darwin
Brought up at https://github.com/apple/swift-corelibs-foundation/pull/5074#discussion_r1723523656
Linux/Darwin provide various error codes like .fileReadNoSuchFile
when provided with an empty path. However on Windows we currently throw .fileReadInvalidFileName
errors. We should make these behaviors consistent. Originally SCL-F already threw .fileReadInvalidFileName
but Darwin threw .fileReadNoSuchFile
. With the swift rewrite of FileManager
we updated Linux to match what Darwin does, but Windows has still diverged. We should update Windows to match the Linux/Darwin behavior so that we have consistency across our platforms