Open
Description
I know of two options that seem likely to do the right thing across platforms:
extension URL {
var fileSystemRepresentation: String {
self.withUnsafeFileSystemRepresentation { String(cString: $0!) }
}
}
import System
extension URL {
var fileSystemRepresentation: String { FilePath(self)!.string }
}
It's unclear which, if either of these, actually does the right thing on a platform like Windows, where the .path
property of a URL
is not in native format. Both are far too indirect.
Metadata
Metadata
Assignees
Labels
No labels