4 ms·
It seems that there's the way to work it around: the order the files are packed matters! https://sourceware.org/ml/cygwin/2009-08/msg00293.html https://sourcew
by acqq 11y ago
It seems that there's the way to work it around: the order the files are packed matters!
https://sourceware.org/ml/cygwin/2009-08/msg00293.html https://sourceware.org/ml/cygwin/2009-08/msg00293.html
> tar -xvzf test.tar.gz
> mydir/myexe.exe
> mydir/myexe
>
> ls myddir
> myexe
"if a file foo.exe exists, and an
application calls stat("foo"), it will get told that, yes, "foo" exists."
But:
"if the order of the files in
the tar archive is reversed, both files are unpacked. Or, unpack
mydir/myexe.exe explicitely afterwards. The reason that this works is
that Cygwin does not check for a file "foo", if the name of the file is
explicitely given as "foo.exe"."
Anybody tried?
Also, it's relatively (as in since some years) recent change: "Cygwin always handled the .exe suffix transparently in terms of stat(2)
calls, but Cygwin 1.7 also handles them transparently in terms of
open(2) and any other call."
- nanis 11y agoThis is illustrated in all three screenshots in my blog post.
- acqq 11y agoNow I think I see it. So it seems confirmed. I haven't fully analyzed the screenshots, I've read just your text, seen the arrow in the screenshot and that way have seen that the files are missing, and only then read the linked explanation from Corina, and that explanation is much clearer: touch or not touch as such is not relevant, only the order of the files in the resulting tar matters, and now it seems to me that your screenshots confirm that: it's just about order during untaring. Thanks.
- nanis 11y agoThe `touch` example is there to show another instance of unexpected behavior: `touch test.exe test` only creates `test.exe`.
- acqq 11y agoIt seems that the archivers ask "does test exist" and when answered "yes" perform "delete test" which by cygwin >=1.7 actually deletes test.exe? Or even worse, the "open test" with some flag results in deleting test.exe and creating test. But it also seems that touch asks "does test exist" and when answered yes it doesn't create it, just changes the datetime. Which probably changes the datetime of test.exe? Anyway it would be good to investigate which actual calls by the user applications are being made in each case, to know what the actual sequence in each case is.