Ralf Wildenhues wrote, quoting Bob Frieshahn: >> Since there is no standard 'file' command provided with MSYS/MinGW, >> is this safe? > > OK, so the only remaining case really is MSYS/MinGW itself. Do we > know of win32 installations that provide a `file' command that does > not do what we expect? Note that not having `file' available would > be fine here, but one that does something completely unrelated, for > example, would hurt.
While it is true that MSYS/MinGW doesn't include a `file' command as standard, it is perfectly feasible to use a `foreign' implementation with MSYS; e.g. I have installed the GnuWin32 v4.16 implementation http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=18878 into my `/usr/local' MSYS tree. Not sure how robust it is; e.g. it misidentifies manpage sources as `MKS Spell hash (old format)', and its own manpage refers to incorrect locations for the `magic' files, but it does seem to identify executables, shell scripts, and `*.a' or `*.dll' libraries reasonably well. There may be a few gotchas, such as:-- * executable names need to be spelled out in full, including the EXEEXT; (file `which sh` says `no such file or directory', but file `which sh.exe` works as expected). * `*.o' files are identified as `80386 COFF executable, not stripped', rather than as relocatable (object) files; (file-3.37 on my Linux box does likewise, for i586-mingw32-gcc compiled objects). * may be some other weirdos I haven't encountered yet... Not suggesting that you should always expect `file' to be present, but some MSYS users may have it. Maybe, if it's needed to improve libtool support, we could consider adding it to a future msysDTK release, or provide it as a mingwPORT. Regards, Keith.
