Code to recognize MS-Word document files?

Grant Edwards grante at visi.com
Tue Mar 4 13:41:00 EST 2003


In article <1046799459.947699 at newsmaster-03.atnet.at>, Thomas Wana wrote:
> WP wrote:
> 
>> // My word files all seem to start like this
>> // (MS Office 2000 WORD iles)
>> //  d0 cf 11 e0 a1 b1 1a e1 00 00 00 00 00 00
>> //  00 00 00 00 00 00 00 00 00 00
>> // Your mileage may vary.

Yup.  That looks like one of the recipes in /usr/share/magic:

 0       string  \376\067\0\043                  Microsoft Office Document
 0       string  \320\317\021\340\241\261        Microsoft Office Document
 0       string  \333\245-\0\0\0                 Microsoft Office Document

The second one seems to match the files I've got laying around
also.

-- 
Grant Edwards                   grante             Yow!  FEELINGS are
                                  at               cascading over me!!!
                               visi.com            




More information about the Python-list mailing list