Re: [dcdev] Searching
Carl-Adam Brengesjö <[email protected]>
2004-01-16 5:49
Direct Connect developers

eric wrote:
But I seem to be the only one that likes the idea with mime types, and
everyone is fighting against me on the subject... `resistance is futile'
- at least it seems to be :(

IMHO, mime types is not the solution. Something like mime-magic is probably better but has its limit. How to handle files with unknown content but known extension and how to handle new file format or "rare" ones (who knows PES format ?).

Magic-mime will give a file with unkown content the type `text/plain' and so it always have a mime type, though it may not be accurate. But event the current system isn't accurate with stuff like that.

What does the current system do if it encounters an unkown file extension when searching for a particular type? It ignores the file! Why cannot this do the same? If you search on `any' with mimetypes the mimetype would be `*/*', and the file will show up with `text/plain' and listed then. Just like it's done now.

And for new file formats - the magic.mime file can easily be updated with a new version of the client, and most people use a newer version of a client when it is released. The file can even be hosted on sites like the hublists, but this requires some bandwidth on the server and new fileformats isn't really released every 5-minutes (relevant fileformats), so it's enough with the mime.magic is updated with a new version of the client (if required).

Filetypes like rar and so is not listed in the current magic.mime (i have version 3.41 of file) but the file has a simple syntax and new fileformats and other unkown can easily be added.

And as a last solution the mime types can be overriden by the client depending on file extension. But this is not recommended as each client could override it with it's own mime types (though a quick way of dealing with it).

As for janvidar's reply to Opera: Yea, you manage to say what I've been trying to say the whole time (I suck on explaining stuff).


DC Developers mailinglist