'file' Command Giving False Positives

Tim Daneliuk tundra at tundraware.com
Fri Jul 2 15:38:19 UTC 2010

On 7/2/2010 10:35 AM, Polytropon wrote:
> On Fri, 02 Jul 2010 11:25:20 -0400, Lowell Gilbert<freebsd-questions-local at be-well.ilk.org>  wrote:
>> Why is it incorrect?  "LZ" as the first two bytes in a file is (unless
>> my memory is badly mistaken) exactly what the old command.com looked for
>> as the flag of an executable.
> If I ask *my* memory, it tells me that what you mean is "MZ". As
> far as I remember, those are the initials of a programmer involved
> with the creation of the DOS binary executable format. :-)

Some OSs report both LZ and MZ as being DOS .exe, some only
report LZ.  Either way, when processing data files, there
needs to be a deeper check to avoid the false positive.
It may be that 'file' just isn't powerful enough to do this.

Tim Daneliuk
tundra at tundraware.com

More information about the freebsd-questions mailing list