Re: What's in matadata.db ?



The metadata.db file is a standard berkley db file.  If you really want to
directly edit metadata.db, I would recommend using python or perl.  Just
as an example, with python I can do:
  >>> import bsddb
  >>> db = bsddb.hashopen('/home/james/.gnome/metadata.db', 'r')
  >>> db.keys()
   (prints keys of metadata.db)
  >>> db['file\0/home/james/.gnome-desktop/cdrom\0icon-caption\0']
  'CD-ROM 0\000'

If you are planning to setup a large number of users, I recommend using
one of the sets of gnome-libs bindings for python, perl or guile.  You can
then use the gnome_metadata_set function to do all this sort of work.

For the example above in python, I can do the following:
  >>> import gnome.metadata
  >>> gnome.metadata.set('/home/james/.gnome-desktop/cdrom',
                         'icon-caption', 'CD-ROM 0\0')
  >>> gnome.metadata.get('/home/james/.gnome-desktop/cdrom', 'icon-caption')
  'CD-ROM 0\000'

I hope this helps,

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Mon, 30 Aug 1999, Stan Brown wrote:

> 
> 	I am trying to set up a reproducable gnome environment to be used as an
> 	inital setup for new users. 
> 
> 	In looking through an environment that I interactively set up, I find a
> 	fair number of references hard coded to the users home directory. Easy
> 	enough to chnge as long as they are in flat files. However some of
> 	these appear to be in medata.db. 
> 
> 	What is this used for. If I create the environments without this will
> 	be automaticly created on login? Will it get the correct information?
> 
> 	If not how can I edit the .db file?
> 
> -- 
> Stan Brown     stanb@netcom.com                                    843-745-3154
> Westvaco
> Charleston SC.
> -- 
> Windows 98: n.
> 	useless extension to a minor patch release for 32-bit extensions and
> 	a graphical shell for a 16-bit patch to an 8-bit operating system
> 	originally coded for a 4-bit microprocessor, written by a 2-bit 
> 	company that can't stand for 1 bit of competition.
> -
> (c) 1999 Stan Brown.  Redistribution via the Microsoft Network is prohibited.
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 



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