-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
FoundationLinuxPlatform: LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.transfer candidateThe issue may belong in another repositoryThe issue may belong in another repository
Description
Description
URL(fileURLWithPath: "images", isDirectory: true).absoluteString
returns file:///home/..../images
This is a problem because when running FileManager.default.contentsOfDirectory(atPath: url.absoluteString)
for example, it will throw an error saying the file does not exist.
Reproduction
let url = URL(fileURLWithPath: "images", isDirectory: true)
print("absoluteString: \(url.absoluteString)")
do {
try FileManager.default.contentsOfDirectory(atPath: url.absoluteString)
} catch {
print("error: \(error)"
}
Expected behavior
absoluteString should return /home/..../images
, not file:///home/..../images
Environment
Swift version 5.10 (swift-5.10-RELEASE)
Target: aarch64-unknown-linux-gnu
Additional information
No response
Metadata
Metadata
Assignees
Labels
FoundationLinuxPlatform: LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.transfer candidateThe issue may belong in another repositoryThe issue may belong in another repository