[openbeos] Re: resource files, application signatures, and icons

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Mon, 30 Sep 2002 00:57:25 -0700

Here's my 2 cents on the matter :-)

Resource files: Having a text based format seems like a better idea 
than binary if it's not going to take too much time to get one set up, 
at the very least due to CVS history and ease of browsing/searching.

Attribute database vs. filestream database: The current mime database 
is a joy to work with. It would take a lot of work to make a file 
format version that was as easy to use, and when all was said and done, 
not only would the code would be considerably more complex, I imagine 
it would also be slower. I would not vote for such a change.

Resource/Attribute files => distro database: If we want to build a mime 
database to include under distro/, my vote is for using the same 
implementation that the system uses, as it will cut down on the chance 
that some little oversight will cause things to be stored differently 
than expected.

At the moment, OBOS::BMimeType is retargetable, but only at compile 
time (for example, OBOS::BMimeType currently works with a database at 
~/config/settings/obos_mime instead of ~/config/settings/beos_mime). I 
don't like the idea of making BMimeType itself dynamically 
retargetable, as there are things the database manager in the registrar 
keeps track of that would have to be ignored for calls that weren't 
being made on the actual database; I don't think the overhead is worth 
it for something that's probably only going to be used during our 
build. 

However, it would be reasonably easy for me to make up some  
{get,set}_[whatever_mime_attribute_suits_your_fancy]() functions that 
only read/write data to which you could specify a different database 
location. One could then write a program that simply takes a given 
resource file/attribute file and writes the appropriate information 
into a separate database somewhere under current/distro/. 

Furthermore, I'm actually planning on sprucing up 
create_app_meta_mime() a bit to more completely address all available 
(and applicable) information in a given application's attributes and 
resources (the R5 implementation does surprisingly little), so whoever 
ended up writing such a tool could probably lift most of the necessary 
code from there, assuming you don't mind waiting for me to get around 
to finishing it. I might even offer to write said tool, but no promises 
yet. :-)

As to using setmime -dump, that reads out of your own database, so 
you'd have to write everything of interest to your own database and 
*then* run setmime -dump on all the types of interest, at which point 
you'd only have a script of setmime calls and not a genuine database. 
So if you really wanted a separate database (which I think is the 
better idea), you'd have to make setmime retargetable as well, and by 
then I think you've probably done more work than just converting from 
resources/attributes directly to a database.

-Tyler


Other related posts: