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 / Adding to the Desktop Database


To add a user comment for a file or a directory to the desktop database, use the PBDTSetComment function.

FUNCTION PBDTSetComment (paramBlock: DTPBPtr; 
                         async: Boolean): OSErr;
A pointer to a desktop parameter block.
A Boolean value that specifies asynchronous (TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine.
\xAE ioResultOSErrThe result code of the function.
--> ioNamePtrStringPtrA pointer to a file or directory name.
--> ioDTRefNumIntegerThe desktop database reference number.
-->ioDTBufferPtrA pointer to the comment text.
--> ioDTReqCountLongIntThe comment length.
--> ioDirIDLongIntThe parent directory of the file or directory.

The PBDTSetComment function establishes the user comment associated with a file or directory in the database specified in ioDTRefNum. You specify the object name through ioNamePtr and the parent directory ID in ioDirID. You put the comment as a plain text string in a buffer pointed to by ioDTBuffer, and you specify the length of the buffer (in bytes) in ioDTReqCount. The maximum length of a comment is 200 bytes; longer comments are truncated. Since the comment is a plain text string and not a Pascal string, the Desktop Manager relies on the value in ioDTReqCount for determining the length of the buffer.

If the specified object already has a comment in the database, the new comment replaces the old.

noErr0No error
ioErr-36I/O error
fnfErr-43File or directory doesn't exist
wPrErr-44Volume is locked through hardware
vLckdErr-46Volume is locked through software
rfNumErr-51Reference number invalid
extFSErr-58External file system--file system identifier is nonzero

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996