Serects of the Desktop Database

How the BNDL & related rsrcs are inserted into the DTDB

Updated April 9, 99: Added more information on the iconData in step 3 (thanks, Jens-Uwe Mager!)

 

Disclaimer

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.

Introduction

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.html

http://developer.apple.com/techpubs/mac/MoreToolbox/MoreToolbox-411.html

The contents in a desktop database

  1. If the "Easy Open" control panel ("File Exchange" since OS 8.5) is installed, one entry is added using the PBDTAddIcon() call with the following parameters:

    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):


  2. The normal Icon data from the BNDL/FREF resources is added to the DTDB (using iconTypes 1-6 as documented in Inside Macintosh).


  3. If a 'kind' resource is present, all its entries are added to the DTDB using PBDTAddIcon() calls with the following parameters:


  4. One Icon entry is added with the following parameters:


  5. If the file is launchable (file type is 'APPL', 'APPC', ...), then a list of file types is created. This list reflects the file types that can be opened by the application (used when dragging a file onto the app's icon, for instance).

    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:

    a) once:

    b) for each file type in the list:

    Note: To make this adding work, the previous iconData for this creator/fileType/iconType needs to be retrieved first, of course.


  6. Additionally, some Icon entries with a iconType of 0 appear in DTDBs. I haven't figured out their origin and purpose yet.

 

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