FilePathsBase.jl icon indicating copy to clipboard operation
FilePathsBase.jl copied to clipboard

basename should return a Path

Open davidanthoff opened this issue 6 years ago • 2 comments

No reason that it returns a String, right?

davidanthoff avatar Nov 28 '19 05:11 davidanthoff

basename returns a string because (1) that's what base does and (2) if you think of a path as collection of string segments then basename should be equivalent to returning the last segment. I suppose if we supported indexing then that would be an argument for having basename return a path version of the string.

rofinn avatar Nov 29 '19 02:11 rofinn

I just thought of another reason why basename should return a String. What should basename(s3path) return? A relative S3Path doesn't really make sense, so would this just return a SystemPath?

rofinn avatar Nov 18 '21 22:11 rofinn