Skip to content

filepath2uri function? #61

@stevengj

Description

@stevengj

Might be nice to have an API to convert file paths to URI paths and file:// URIs, e.g. something like:

filepath2uripath(path::AbstractString) = join(map(escapeuri, Base.splitpath(path)), '/')
filepath2uri(path::AbstractString) = "file://" * filepath2uripath(path)
filepath2uri(host::AbstractString, path::AbstractString) = "file://" * host * "/" * filepath2uripath(path)

as discussed on discourse.

(There might be some additional wrinkles, e.g. in the treatment of absolute vs. relative paths or Windows \\server\path UNC paths.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions