shared-mime-info: match offset attribute with '>' expressions?

David Faure dfaure at
Tue May 9 14:00:52 EEST 2006

On Monday 08 May 2006 13:46, Daniel Leidert wrote:
> Hello,
> A question. The (probably outdated?) shared-mime-info database
> specification states, that the offset attribute can contain a single
> number or a range in the form 'start:end'. But KDE MIME magic e.g. also
> allows an expression '>start'. Wouldn't it be nice to have such an
> expression too?

I think you are confused about the expression ">start". This syntax, coming from
the magic file for the file(1) command, means " and if the data at [start] is ".
It's a continuation line, used to add a new criteria to a previous line, the ">" basically
means "and". Not "starting from". For mimetype-determination-from-contents to be
fast, offsets have to be fixed, not variable. At least this was the case back when file(1)
was implemented, maybe today's computers are fast enough for your request to be
valid; I just wanted to point out a misunderstanding about the file(1) (and kde's) syntax.

David Faure, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (

More information about the xdg mailing list