Re: [RFD] Debian's mime support
On Fri, Nov 24, 2000 at 10:49:47PM -0800, Aaron Lehmann wrote:
> > We can do mime a lot better. And we should.
> Your proposal focuses mostly on filename extensions and regexps for
> determining a file type. I consider this an ancient microsoftism that
> prevents me from naming files the way I want them to. But I did see
> your reference to magic numbers, which gives the proposal most of its
> redeeming value :).
Actually, the focus is on providing the sort of things needed by things
like Gnome and KDE, improving the environments recognized beyond X-or-not,
and giving us a menu-like mechanism to allow us to update the mime-types
known about by Gnome and the like without them having to support what
we're doing explicitly. If they'd like to support our database directly,
it'd rock since the update script would run faster and do less.
I'd still rather see mime types in a file's resource fork, but the chances
of convincing the Linux kernel people to support accessing a resource fork
at the VFS layer are slim, to say nothing of adding them to the standard
filesystems. Ask ten people if they're a good idea and you'll get twenty
answers, etc, etc.. Still, what I have in mind here could mesh with that
places like the HURD and Gnome where these things are supported. But
clearly it's designed to work without them.
> I am a huge fan of file(1), and I love the idea of determining a file
> type based on a magic number. However, I am not so happy about the
> idea of the computer second-guessing me from my file naming habits. If
> you can make the system allow the individual users on the system
> change their preference of which methods will be used to determine the
> types of a file and which have the highest precedence, the proposal
> will have my full support.
What the programs use to determine filetype is entirely up to the program.
All we can do is provide the best matches we can in terms of extension
where possible, regex where necessary, magic where reasonable. If the
apps support none or all of these, not much we can do about it.
There is a patch for libfile which returns mime type based on magic. That
could be modified to use the database and fall back on the other ways of
identifying. I doubt any appropriate patch to libfile's magic will make
it recognize text/x-makefile unless it considers the file's name is
"Makefile" since #!/usr/bin/make is not always correct for the make you
have installed (though it might be on your system and you could add that
Joseph Carter <email@example.com> GnuPG key 1024D/DCF9DAB3
Debian GNU/Linux (http://www.debian.org/) 20F6 2261 F185 7A3E 79FC
The QuakeForge Project (http://quakeforge.net/) 44F9 8FF7 D7A3 DCF9 DAB3
<Knghtbrd> QF is going to get zipfile support today
<Coderjoe> heh... infozip?
<Knghtbrd> If I'm lucky yes
<Deek> knghtbrd: You're kidding, right? ;)
* Deek takes away Knghtbrd's crack pipe. ;)