haskell / filepath

Haskell FilePath core library
BSD 3-Clause "New" or "Revised" License
66 stars 32 forks source link

normalise should eliminate parent directories on Windows #57

Open Rufflewind opened 7 years ago

Rufflewind commented 7 years ago

Windows seems to interpret paths differently than on POSIX systems.

This feature would be useful to have because if you want to pass in extended-length paths (the \\?\ prefix) you have to normalize the path before adding the prefix, otherwise the Windows API will interpret .. literally.

ndmitchell commented 7 years ago

What if you do the Windows style path on a Mingw shell - does it expand before or after dereferencing?

Rufflewind commented 7 years ago

Tried it in the MSYS shell (that one that comes with Stack):

ndmitchell commented 7 years ago

That's disturbingly inconsistent... I guess you need two separate methods, one which expands .. and one which doesn't.

hasufell commented 3 years ago

@Rufflewind is this observed behavior or is there something in windows documentation suggesting this is behavior that can be relied upon?

Rufflewind commented 2 years ago

I have not seen documentation around it but I haven't really tried looking per se. It's just a quirk I observed when trying to test native symbolic links on Windows.