Raynes / fs

File system utilities for Clojure.
453 stars 119 forks source link

file function broken on windows #98

Open glchapman opened 8 years ago

glchapman commented 8 years ago

On windows, a path of the form "/a/b/c" (or "\a\b\c") is not considered absolute (since it lacks a drive letter), so the file function will prepend the cwd, returning a bogus path.

Looking at the javadoc for java.io.File, it appears the the getCanonicalPath/getCanonicalFile methods will handle all of the OS complications for us -- they seem to handle both "." and ".." as well as relative paths (without a leading slash). Perhaps the file function could be changed to use getCanonicalFile?