Why is there no URL.standardizingpath?

NSURL.standardizingpath is great, why is it not available on URL? It's a pretty critical function for any path datatype.

I suspect it wasn't imported because the NSURL.standardizingpath internally calls NSString.expandingTildeInPath. But that's a pretty weak reason to prevent the import because:

  1. That's a really simple function. Even without expandingtildeinpath being available on Swift.String, it's trivial to reimplement in native Swift.
  2. It doesn't make sense to have path-related operations on NSString/String in the first place, if we have a potent path datatype like NSURL/URL.
1 Like

@Tony_Parker can probably answer to that... but he might have his hands full atm with dubdub, so cut him a bit or two of slack :slight_smile:

It is available as standardizedFileURL (in corelibs and the overlay).

Maybe the documentation could be improved?

2 Likes

I think we may have changed the name of this one because of the confusion between the word path and the type being URL.

1 Like

a url contains a path…