[Linux-aus] enum in /etc/magic
    Russell Coker 
    russell at coker.com.au
       
    Sun Jun 15 21:20:21 EST 2014
    
    
  
I've got an enum in a data structure that I'd like to display in the output of 
file(1).
0       beshort                 0xfe01          MySQL table definition file
>2      byte                    x               Version %d,
>3      byte                    9               Type MYISAM
>3      byte                    12              Type INNODB
The above is a sample of what I'm doing, values 9 and 12 in byte 3 correspond 
to MYISAM and INNODB entries for the MySQL FRM file.
https://github.com/twitter/mysql/blob/master/sql/handler.h
The above URL has what seems to be a complete list, so I could write 31 lines 
in /etc/magic for this, but that's ugly.  Is there a way I can specify a list 
of values to match followed by a list of strings to display and not have 31 
lines?
I'd like to develop a patch that can be accepted into the Debian package and 
hopefully upstream so it has to be the least ugly way of doing it.
-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
    
    
More information about the linux-aus
mailing list