D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6147 - file scheme uri from file path and vice versa
Summary: file scheme uri from file path and vice versa
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-11 08:29 UTC by Mariusz Gliwiński
Modified: 2015-01-25 17:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mariusz Gliwiński 2011-06-11 08:29:31 UTC
It would be useful to have it built in with phobos. I believe it's quite common and generic pattern, so people wouldn't have to inverse slashes conditionally on windows (+glue of course).
Comment 1 AndyC 2015-01-25 17:42:21 UTC
This question isn't very specific, I'm not sure what's being asked for.

"file scheme uri" sound like:  file://c:\bob.txt --> c:\bob.txt

but the comment says "have to inverse slashes", which sounds like:  c:\bob.txt --> c:/bob.txt

First, windows, in most operations can use either slash.
auto f = File("c:\bob.txt")
auto f = File("c:/bob.txt")

should both work.

Second, there is std.path.buildNormalizedPath, and the doc for std.path documents several other spots where different slashes are respected.

I'm guessing that was commit here:

https://github.com/D-Programming-Language/phobos/commit/6364506918446fb62816f92ac621a71bff88dbdf?diff=unified

I'm gonna close this, but please re-open if I've misunderstood the question.  (And maybe you could post some samples of what you're looking for)