I was trying to split a directory for path and filename in a code. Was not aware of existence of splitdir() method. So I wrote a code like:
rsplit(filepath, “/”, limit=2) to get the filename. Julia didn’t seem to like it on the Windows platform breaking the build.
If there would have been a method like fileseparator() which would return “/” on Linux and “\” on Windows I could write the code as:
rsplit(filepath, fileseparator(), limit=2)
This could give other flexibilities as well.
Note: Some systems (like cygwin) develop normalized paths as well like:
- ‘/’ is the file separator in all platforms
- //< Drive Letter>/ for windows like drive letters on unix like platforms. like say //C/Windows/