g at intersect-uk.co.uk
Fri Oct 17 14:28:43 EEST 2003
On Wed, Oct 15, 2003 at 02:14:58AM +0200, Jaap Karssenberg wrote:
> On Tue, 14 Oct 2003 15:27:33 +0100 Thomas Leonard wrote:
> > Aliases are for when you've got a MIME type from some external
> > source, and you want the 'standard' name. It also lets us deprecate
> > old MIME names(x-midi -> midi, etc). I think everyone should support
> > it.
> > Currently, there is no output 'aliases' file to make this easy, but
> > there will be. Don't let that stop anyone from adding updates to the
> > XML as it is now...
> So aliases are mainly used for alias => standard name lookup; I can
> see that would be useful. When a special aliases file is outputted the
> libs can have a simple interface for this.
Will that just be a simple text format, like the patterns?
And will valid aliases be invalid mimetypes within the system? ie.
failing to translate an alias to the real mimetype will mean that no xml
information file is found. Or will update-mime-database create, for
example, symlinks from the alias names to the real xml file, which would
allow a lightweight implementation to lookup filetype info without
having to parse the aliases file? Or would this limit implementation
too much (given that not all filesystems support symlinks)?
> > > Could the default method for deciding between
> > > application/octet-stream and text/plain be specified in more
> > > detail, what -for example- is a sane number of chars to check from
> > > the beginning of the file ?
> > Does 32 sound reasonable?
> Sounds good to me, although 42 would be the ultimate answer ;)
> Implementations will never be completely the same but it would be nice
> if they use the same heuristics - makes it less obfuscated for users.
I personally determine the maximum pattern length, read that in when
first scanning the file and use all of that, but 32 should be fine for
all the binary formats I can remember coming across...
More information about the xdg