Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 9 - Desktop Manager / Desktop Manager Reference
Routines / Locating, Opening, and Closing the Desktop Database


You can get the reference number of the desktop database using the PBDTGetPath function.

FUNCTION PBDTGetPath (paramBlock: DTPBPtr): OSErr;
A pointer to a desktop parameter block.
\xAE ioResultOSErrThe result code of the function.
-->ioNamePtrStringPtrA pointer to the volume name or full pathname of the desktop database.
-->ioVRefNumIntegerThe volume reference number of the desktop database.
\xAE ioDTRefNumIntegerThe desktop database reference number.

The PBDTGetPath function returns the desktop database reference number in the ioDTRefNum field, which represents the access path to the database. You specify the volume by passing a pointer to its name in the ioNamePtr field or a volume reference number in the ioVRefNum field. If the desktop database is not already open, PBDTGetPath opens it and then returns the reference number. If the desktop database doesn't exist, PBDTGetPath creates it. If PBDTGetPath fails, it sets the ioDTRefNum field to 0.

You cannot use the desktop reference number as a file reference number in any File Manager routines.
Do not call PBDTGetPath at interrupt time--it allocates memory in the system heap.
noErr0No error
ioErr-36I/O error
extFSErr-58External file system--file system identifier is nonzero
desktopDamagedErr-1305The desktop database has become corrupted--the Finder will fix this, but if your application is not running with the Finder, use PBDTReset or PBDTDelete

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996