Open nurous opened 10 years ago
https://github.com/Raynes/fs/pull/87 Solves this, right?
This problem is not solved by #87:
me.raynes.fs> (expand-home "~/test.txt")
#object[java.io.File 0x6bafd5ca "C:\\Users\\test.txt"]
me.raynes.fs> (expand-home "~\\test.txt")
#object[java.io.File 0x5cc7b90a "C:\\Users\\hans\\test.txt"]
As you see, if a forward slash is used as path separator, the path is corrected incorrectly, while it is correctly constructed with a backslash.
@Raynes Do you want to merge this or should I close it?
expand-home does not add the home to the path when on windows and the path string uses unix style path separators (which is generally OK in Java). Fix seems to be just ensure the path passed in is converted to a File object first which will convert the unix style separators to File/separator.