Does KMimeMagic really work with config/magic/*.magic files ?
Guillaume Laurent
glaurent at telegraph-road.org
Fri Feb 20 23:07:18 GMT 2004
On Friday 20 February 2004 23:45, David Faure wrote:
> On Friday 20 February 2004 23:34, Guillaume Laurent wrote:
> > I'm trying to add a "magic mimetype" for rosegarden files. It's copied
> > from KOffice's old type. If I add the line
> >
> > >10 string audio/x-rosegarden\000 audio/x-rosegarden
>
> The leading ">" means continuation...
> This line alone doesn't make sense, it would have to follow a line that
> doesn't start with a ">".
It does. As I said, our mime type is copied from KOffice old one (we also use
gzipped xml), so to try it I added that line right after the ones describing
the old KOffice format in mimelnk/magic, like this :
# KOffice documents (gzipped, with an idenfication string in the 'orig
filename' header)
>10 string KOffice
>>18 string application/x-kchart\004\006 application/x-kchart
>>18 string application/x-kformula\004\006 application/x-kformula
[...etc...]
>10 string audio/x-rosegarden\000 audio/x-rosegarden
#KOffice documents post v1.1 (may 1 2002) using zip as a wrapper
...
Hence why it worked
> Try without the ">". If it still doesn't work, you might have the problem
> that anything in the main magic file has priority over the rest
Looks like that's what's happening :-(. The gzip line matches first.
> - if a rule
> matches there, however generic it might be, any following rule (later in
> the file or in a *.magic file) won't be even looked at. So this doesn't
> work for e.g. ZIP-derived formats.
And gzipped-derived ones too... Would it be acceptable that I commit RG types
(we have 2) in the main KDE mimelnk/magic file, then ?
--
Guillaume.
http://www.telegraph-road.org
More information about the kde-core-devel
mailing list