fs icon indicating copy to clipboard operation
fs copied to clipboard

Change 'expand-home' to support Unix style paths on windows.

Open nurous opened this issue 11 years ago • 3 comments
trafficstars

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.

nurous avatar Mar 05 '14 01:03 nurous

https://github.com/Raynes/fs/pull/87 Solves this, right?

Raynes avatar Jan 14 '16 05:01 Raynes

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.

hanshuebner avatar Sep 03 '16 07:09 hanshuebner

@Raynes Do you want to merge this or should I close it?

nurous avatar Oct 11 '21 02:10 nurous