Re: theme file types

On Wed, 2004-03-17 at 13:33, Daniel Brodie wrote:
> >  For recognizing the file type, we should just have a new extension on
> > mime type.  Something like application/x-meta-theme and the extension
> > .theme.  The former will allow our theoretical attribute-based file
> > system to work, and the later will work on real-life machines today. 
> > ;-)
> Based on the new nautilus plugins wouldnt it just be possible to have a
> plugin check if the .tar.(gz|bz2|bzip) file had an aprropriate file?
> Specifically:
> 1. if contains a gtk-2.0/gtkrc file it is a gtk theme
> 2. if it contains a metacity-1/metacity-theme-1.xml it is a metacity
> theme
> 3. if it contains an index.theme file and the file has an [Icon Theme]
> section in it it is an icon theme

Looking inside a tarball isn't very easy. Zipfiles are neat since they
have an uncompressed directory table at the end of the file that you can
peek at. For tar files the file-names are next to each file (so that
appending is easy - it makes sense when you remember tar means "tape
archive"). Additionally when you compress tarballs if you want to
extract the filenames you have to decompress all the file data too since
you can't just seek through a gzip stream.

The *right* solution is to have a unique magic number for all different
file types. Magic numbers make everyone happy. There are a few
mechanisms for providing magic numbers that uniquely identify gzip
streams. One is to add a comment another is to add an extension field. 

*flash of light*

We could just define a gzip extension field for mime-type. Call it 'MT'
and stuff the desired mime-type. Then gnome-vfs can have a very trivial
sniffing function that looks for the extension field and and return that
mime type.

A command-line utility to add/display/remove this extension field would
be trivial.


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