Updated April 9, 99: Added more information on the iconData in step 3 (thanks, Jens-Uwe Mager!)
The following information is brought to you by Thomas Tempelmann ( ). It has been retrieved by a extremely smart computer called "Deep Thought Is A Sap" running an extremly sophisticated piece of software written be me in BASIC that stared for many years at the Desktop DB and Desktop DF files, trying to make sense of them. However, it still can not be guaranteed that all the information herein is correct. Use it at your own risk.
Apple did not provide the information, Apple will not support the information, and the validity of this information is subject to change at any moment (that means: future Mac OS versions as well as foreign File Systems might behave differently).
There is, however, some information that you or I may get from Apple and that we're not allowed to publish, because Apple wants to keep it confidentially. When in doubt, contact Apple's developer support and ask for the information you need.
This document describes the contents of the Desktop Database as used on volumes > 2 MB, stored in two files called "Desktop DB" and "Desktop DF", insibly created in the root directory of (almost) every Mac volume.
There's currently (as of Mac OS 8.5) three kinds of resources that are transferred to the Desktop Database from any file that has the hasBNDL bit set:
Information about the the latter two is documented in these technotes:
http://developer.apple.com/techpubs/mac/MoreToolbox/MoreToolbox-410.htmlhttp://developer.apple.com/techpubs/mac/MoreToolbox/MoreToolbox-411.html
When a volume is mounted, Easy Open looks for that entry and will cause a desktop rebuild if it is not present.
The following happens for each file that has a BNDL resource when either the desktop is rebuilt or the Finder sees a file with the "Inited" flag not set (also seems to happen when the Finder gets a "kSync" AppleEvent on a file):
If a 'open' resource is present, the list is created from all of its entries. If a 'open' resource is NOT present, the list is created from the list of FREF entries referred by the BNDL entries instead, excluding the app's file type.
Then the following Icon entries are added to the DTDB:
Note: To make this adding work, the previous iconData for this creator/fileType/iconType needs to be retrieved first, of course.
That's all I know so far.
One thing I'm still working is the case when the Finder adds information about a file that has already some recorded information in the DTDB.
See my web site for more related and updated information: http://www.tempel.org/macdev
Thomas