snoyberg / tar-conduit

Conduit based tar extraction mechanism
MIT License
8 stars 9 forks source link

Forward slashes windows #22

Closed snoyberg closed 5 years ago

snoyberg commented 6 years ago

I noticed that AppVeyor wasn't configured correctly before. I've included a (mostly unrelated) commit to update the CI scripts so that this PR gets tested correctly on Windows. I'm also going to cherry pick to master and then, after getting everything working, we can rebase this PR.

lehins commented 5 years ago

It seems that the test suite is failing since the \ now means something different for Windows and tar (an Linux too). So tar/untar test fails since taring with \ returns back / when tared again. This seems to be consistent behavior among other tools like tar and 7z. On Linux:

$ mkdir baz
$ echo foo > "baz/foo\\bar"
$ $ ls baz
foo\bar
$ tar -cf funky.tar baz

On Windows:

PS C:\> tar -xf funky.tar -C .\tmp
PS C:\> dir .\tmp\baz\foo

    Directory: E:\haha\baz\foo

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-----         8/24/2018   5:48 PM          4 bar

One simple way I think test could be fixed is to remove \ from generator all together: filePath <- ("test-" <>) . (filter (/= '\\')) <$> asciiGen filePathLen

snoyberg commented 5 years ago

Banning \\ from the generator seems reasonable, would you be able to do that?

lehins commented 5 years ago

Hey @snoyberg All of the comments we discussed here (plus another windows peculiarity I found in the mean time) I addressed in this commit: 6c436edea9b6b3b5dd397daa6e322011cb9cd7c2. I also grabbed the commit fd03a66110f7d0feff6fe7eb1cc9ca1a56b38fea from this PR that fixes the file path separator. All of that stuff together with lenient untarring functionality is in #23 PR and is rebased on master. So, we can close this PR and if you could review #23, we could make a new release.