rofinn / FilePathsBase.jl

Filesystem path types in julia
Other
80 stars 17 forks source link

Support `cp(::AbstractPath, ::AbstractString)` and vice-versa? #122

Open ericphanson opened 3 years ago

ericphanson commented 3 years ago

This comes up when users try things like cp("~/my_file", S3Path("...")). Since often users first encouter the filepaths system via special paths like S3Paths, they don't realize they need to fully "opt-in" to the ecosystem by wrapping the first argument in Path. (In other words: folks probably have not even done using FilePathsBase and might not realize there is a parallel path system). I think adding methods that wrap AbstractString arguments in Path would help ease interoperability.

rofinn commented 2 years ago

Yeah, I'll take another look that this. There is the FilePaths.@compat macro, but depending on the use case it can often introduces ambiguities. I'm a little nervous about introducing automatic conversion for some methods if it'll introduce ambiguities on others. Seems like that kind of inconsistency is worse than doing nothing at all.