[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MIME type for PDB files.



Am Dienstag, den 15.01.2008, 14:10 +0100 schrieb Morten Kjeldgaard:
> >
> > as per .pdb format version 2.3, all records must start with a HEADER
> > field.
> 
> Actually, a valid PDB format file must start with a HEADER record.  
> All records must start with a max 6 character long record type, i.e.  
> HEADER, COMPND, ATOM, etc.
> 
> But is the content of the file relevant for the mime-type?

Yes. Search for content pattern, magic number, etc.

> I thought  
> it had to do with the extension only (and for PDB files, the typical  
> extensions are .pdb and .ent).

Maybe in DOS times, files were perfectly represented by a 3 char file
suffix. Today you sometimes have more than 10 different file formats for
one file suffix. PDB is an example. Files ending with .pdb could be
chemical/x-pdb or application/x-palm-database. But these files have
different content, so you can use content pattern to make the decision,
if you have a Palm DB or a Protein DB file.

PS: Allmost all current existing MIME detection system use file and
content pattern to detect the MIME type, that represents the file type
(e.g. libmagic (also used by mod_mime_magic and KDE3), gnome-mime-data,
shared-mime-info).

Regards, Daniel


Reply to: