Skip to content

Support the "file" URI scheme #59

@omus

Description

@omus

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", [], [])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions