3 ms·
It's not ridiculous behaviour; it's the correct behaviour for Cygwin in almost all cases. Windows executables are identified by their extension. That's in dire
by barrkel 11y ago
It's not ridiculous behaviour; it's the correct behaviour for Cygwin in almost all cases.
Windows executables are identified by their extension. That's in direct conflict with POSIX-style executables. You wouldn't want to have to execute every command-line tool like ls.exe, cp.exe, bash.exe, rm.exe etc. So Cygwin looks on the filesystem twice: both with and without the exe extension.
Similar things need to happen when building code from tarballs. It's not just finding executables to actually execute; compilers and linkers need to work correctly too, and random build scripts aren't going to always be checking for the .exe version of files. So the behaviour applies to reading and writing as well.
Tar is already surprising in that it overwrites by default, potentially including the archive you're extracting from. It's usually a bad idea to extract tar archives into anything other than empty directories, unless you know exactly what you're doing.
- jcoffland 11y agoYou are missing the point of the bug/feature described in the article. Neither me or the OP are arguing that you should have to type cp.exe to run the executable. The tar program should always just extract the files contained in it. Instead it overwrites some of them in some cases. This is perhaps related to calling a program with or with out the .exe extension but is only an unnecessary side-effect.
- barrkel 11y agoI noticed that after I wrote the comment, but I doesn't affect my opinion that this is still the correct behaviour for Cygwin. If anything, there should be Cygwin compatibility code added to tar.