Skip to content
New issue

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

Support the "file" URI scheme #59

Open
omus opened this issue Aug 17, 2021 · 1 comment
Open

Support the "file" URI scheme #59

omus opened this issue Aug 17, 2021 · 1 comment

Comments

@omus
Copy link
Contributor

omus commented Aug 17, 2021

It would be good if the "file" URI scheme was supported as defined in: https://datatracker.ietf.org/doc/html/rfc8089

More specifically I was trying to use the "file" URI with mkpath which did not work as expected:

julia> using FilePaths, URIs

julia> using FilePathsBase: /

julia> uri = URI(cwd() / p"test/runtests.jl")
URI("file:///private/tmp/demo/test/runtests.jl")

julia> p = Path(string(uri))
p"file:/private/tmp/demo/test/runtests.jl"

julia> mkpath(dirname(p))
p"file:/private/tmp/demo/test"

julia> readdir(cwd())
1-element Vector{String}:
 "file:"

julia> collect(walkdir(cwd()))
6-element Vector{Tuple{String, Vector{String}, Vector{String}}}:
 ("/private/tmp/demo", ["file:"], [])
 ("/private/tmp/demo/file:", ["private"], [])
 ("/private/tmp/demo/file:/private", ["tmp"], [])
 ("/private/tmp/demo/file:/private/tmp", ["demo"], [])
 ("/private/tmp/demo/file:/private/tmp/demo", ["test"], [])
 ("/private/tmp/demo/file:/private/tmp/demo/test", [], [])
@rofinn
Copy link
Owner

rofinn commented Aug 17, 2021

That doesn't work in base Julia either though. I think that should probably be a different path type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants