Closed
Description
let url = URL(fileURLWithPath: #"C:\"#)
url.withUnsafeFileSystemRepresentation { filePath in
print(String(cString: filePath! , encoding: .utf8))
}
prints C:
. Dropping the trailing backslash is problematic here because C:\
is considered a root directory in Windows but C:
is not (see table of examples in https://learn.microsoft.com/en-us/windows/win32/api/pathcch/nf-pathcch-pathcchisroot).
Metadata
Metadata
Assignees
Labels
No labels