We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL.withUnsafeFileSystemRepresentation
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).
C:
C:\
The text was updated successfully, but these errors were encountered:
URL.path
PathCchIsRoot
jrflat
No branches or pull requests
prints
C:
. Dropping the trailing backslash is problematic here becauseC:\
is considered a root directory in Windows butC:
is not (see table of examples in https://learn.microsoft.com/en-us/windows/win32/api/pathcch/nf-pathcch-pathcchisroot).The text was updated successfully, but these errors were encountered: