-
Notifications
You must be signed in to change notification settings - Fork 17
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
replace
fails for file paths
#158
Comments
My current work around: julia> using FilePathsBase
julia> replace(p::P, args...; kwargs...) where P <: AbstractPath = P(replace(string(p), args...; kwargs...))
replace (generic function with 1 method)
julia> replace(args...; kwargs...) = Base.replace(args...; kwargs...)
replace (generic function with 2 methods)
julia> replace(PosixPath("/a/b/c"), "b" => "c")
p"/a/c/c" |
FWIW, I think if we were to support this we'd have the same behaviour as a collection of strings. julia> replace(("a", "b", "c"), "b" => "d")
("a", "d", "c") |
You mean not treating the path as a string but rather doing replacement on each component of the path? |
That's correct. I think random string operations should be reserved for subtypes of |
The text was updated successfully, but these errors were encountered: