Re: Magic is useless!



On Mon, 7 Jan 2002, Maciej Stachowiak wrote:

> > Most major file formats already have a detectable magic byte
> > signaturate, though some of the now prospering "human readable"
> > formats using XML or whatever are a thorn in the side (particularly
> > if they are compressed, grr). But this would be a good complement.
> 
> XML is reasonably OK, actually, since a proper XML document has a DTD
> declaration at the top that you can look for. The main problem is
> compressed files and archives, since you need to either look inside
> the compression/archiving, or allow suffixes to take precedence for
> those types (returning to the bad old suffix-based world for those
> kinds of files). We really should come up with a solution to this in
> gnome-vfs, since it is a frequent user complaint.
> 

It makes sense to put composite xml/non-xml (or really, even composite xml
made out of many independent parts) documents into a container. Zip is a
good format as it allows for compressed and uncompressed storage (so you
don't waste time trying to re-compress those .jpgs) and internal directory
structure.

A pure magic number system cannot even cope with .jar files and these are
also quite widespread in the real world.

>
>   - Maciej
> 

	Sander

	I see a dark sail on the horizon
	Set under a dark cloud that hides the sun
	Bring me my Broadsword and clear understanding




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