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

Todd Pederzani wrote:
Carl-Adam Brengesjö wrote:

And all other suggestions for deciding filetype have been so far to have it being based on filextensions, wich is not the same!

The best suggestion so far is to leave the current system of file types (where a type is some set of file extensions) in place.
Again: what does using MIME types gain us over file extensions?

Guessing MIME types are done by look on the actual data, not just the name of the file. And therefor searching for a particular file extension should be done in the filename pattern. So if you want to search for the _type_ of file, file extension are no good.
Using MIME types allows the user to search for the _type_ not the fileextension, and I say again. If you want to search for the file extension: use the filename pattern!

I searched on DC now for rar files, using filename pattern "." and `filetype' compressed. What I got was *.zip and *.rar, but what with *.r01, *.r02 (etc) ? Using mime types here would return _all_ files that are rar files.

Sure,  we could basically recreate/port the unix way of guessing mime type, but... why?  It gains us nothing, and it adds complexity and uncertainty.  Not all will handle MIME guessing the same, so you've just introduced interoperability issues.

Not all clients will decide filetypes on extension either. When I did my search described above - I got 7 (SEVEN!!) hits on directories that ended with ".ra", and therefor treated as compressed files (the clients who responded used DC++ 0.303, is this fixed in newer releases?).

I say again, filetypes with mime decides the type depending on the actual _data_, what it contains. File extension is basicly just a cheap trick to `know' it's type even before the file has been opened, and can therefor be easily faked - or mistaken.

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 :(

I have to say same thing over and over in this matter (with different words) and either is it you that don't understand what I'm saying, or it's me who doesn't understand what I want to be said (or needed to be said) :/ either way we are not making any progress. I give up! :p


DC Developers mailinglist