Meta-info on files



Everybody seems to want meta-info on files.  I propose this plan
(which, regardless of its merits, is at least New!  Different!  On
Sale at your Local Grocer's Now!):

There's a library for dealing with file types.  Ordinarily, the
library identifies files two ways: One, it looks them up in
/usr/lib/magic.  If the file is a known type, it gets assigned a MIME
type.  There's a lookup table which assigns properties (icon, viewer,
editor, whatever) to the MIME types.  That's easy enough, and 90% of
it is there.  The other method is to look up the filename in a
database and assign MIME types that way.  That way, *.g3 files get
identified as fax files, since they don't have a magic number.  And
programs, which would otherwise get a generic "executable" icon, could 
be assigned individual icons.  And files in /var/spool/fax/incoming
would be identified as faxes even without a g3 extension.

The NewDifferent part is to create a new file type (call it, say,
GnomePack, with a .gp extension) with a new magic number.  When a
GnomePack-cognizent application loads up a GnomePack file, it knows
that there is a resource fork and a data fork.  Any items in the
resource fork override the properties which would otherwise comes from
the MIME properties table.

Obviously, this works great across NFS, FTP, HTTP, and generic Unix
filesystems.  It works great with all file manipulation packages, cp,
mv, ln, tar, cpio (etc).  It doesn't work transparently from
application to application.  However, that isn't a killer, because we
don't have to be stupid about it.  The headers can be text instead of
binary.  So, text editors will deal, if the users are just barely
smart enough to leave the headers alone.  And we can have a pair of
programs, ungp and regp which remove and create the header.  And
gnome-libs can have "readdatafile" and "writedatafile" functions which 
take care of removing/creating the headers.



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