MIME-type magic hierarcy

Christos Zoulas christos at zoulas.com
Wed Jan 23 22:43:19 EET 2008


On Jan 23, 10:40am, colin at e-e.com (Colin Bartolome) wrote:
-- Subject: MIME-type magic hierarcy

| I've got a similar problem. With rules like this:
| 
| 0  string      DOC
|  >144  string   JDASH    application/x-ichitaro4
| 
| I can make a test file that produces this output:
| 
| [user at host ~]$ file -im magic doc
| doc: application/x-ichitaro4
| [user at host ~]$
| 
| Then I can change the file so the DOC rule matches but the JDASH rules 
| doesn't. Then I get this output:
| 
| [user at host ~]$ file -im magic doc
| doc:
| [user at host ~]$
| 
| Also note what happens when I add the -k flag, as it matches all the DOC 
| rules but none of the continuations:
| 
| [user at host ~]$ file -rkim magic doc
| doc:
| -
| -
| [user at host ~]$
| 
| I think there should be a flag where if a rule's continuation doesn't 
| match, nothing in the entire tree is printed and it just moves on. This 
| file should just wind up as text/plain.
| 
| Please let me know if there's already an option for this.
| 

What version of file are you using? I believe this is fixed in 4.23.

christos



More information about the File mailing list