filepath.Join or path.Join


(Panos Georgiadis) #1

I am wondering what I should pick between the two:

  • filepath.Join
  • path.Join

From you experience so far, is there any big advantage using one over the other?


(Norbert Melzer) #2

It depends on your use case.

path.Join will always use / to join segments, eg for URLs, filepath.Join though will use the separators of the operating system you are using, eg. \ for windows and / for linux and mac.