[Christoph Biedl]
> Well, file has an option
>
> |    -z, --uncompress
> |            Try to look inside compressed files.
>
> but it doesn't give much help since
>
> | $ file -z ./data/examples/himno_de_riego.rg
> | ./data/examples/himno_de_riego.rg: XML 1.0 document, UTF-8 Unicode text, 
> with very long lines (gzip compressed data, was "himno_de_riego.rg.xml", last 
> modified: Wed Feb 23 00:22:42 2011, from Unix)
>
> So I'm considering to modify file(1) to pick the string that follows
> the first "doctype". Does that sound like a solution for you?

Yes.  It would make it possible to recognize some more file types, at
definitely the Rosegarden format.  Might be a good idea to recognize the
toplevel XML tag (here <rosegarden-data>) ro recognize even more
formats.  But requiring -z for this to work is not a good idea, as most
tools using file to figure out the file format will use file without the
-z option.  Perhaps some formats should be uncompress for a peek
automatically?  Might even make it possible to recognize tar.gz files as
such. :)

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to