Carbon


AddFolderDescriptor

Header: Folders.h Carbon status: Supported

Copies the supplied information into a new folder descriptor entry in the system folder list.

OSErr AddFolderDescriptor (
    FolderType foldType, 
    FolderDescFlags flags, 
    FolderClass foldClass, 
    FolderLocation foldLocation, 
    OSType badgeSignature, 
    OSType badgeType, 
    ConstStrFileNameParam name, 
    Boolean replaceFlag
);
Parameter descriptions
foldType

Pass a constant identifying the type of the folder you wish the Folder Manager to be able to find. See “Folder Type Constants”.

flags

Set these flags to indicate whether a folder is created during startup, if the folder name is locked, and if the folder is created invisible; see “Folder Descriptor Flag Constants”.

foldClass

Pass the class of the folder which you wish the Folder Manager to be able to find. The folder class determines how the foldLocation parameter is interpreted. See “Folder Descriptor Class Constants” for a discussion of relative and special folder classes.

foldLocation

For a relative folder, specify the folder type of the parent folder of the target. For a special folder, specify the location of the folder; see “Folder Descriptor Location Constants”.

badgeSignature

Reserved. Pass 0.

badgeType

Reserved. Pass 0.

name

A string specifying the name of the desired folder. For relative folders, this is the exact name of the desired folder. For special folders, the actual target folder may have a different name than the name specified in the folder descriptor. For example, the System Folder is often given a different name, but it can still be located with FindFolder.

replaceFlag

Pass a Boolean value indicating whether you wish to replace a folder descriptor that already exists for the specified folder type. If true, it replaces the folder descriptor for the specified folder type. If false, it does not replace the folder descriptor for the specified folder type.

function result

A result code. The result code duplicateFolderDescErr indicates that a folder descriptor is already installed with the specified folder type and replaceFlag is false.

DISCUSSION

The AddFolderDescriptor function copies the supplied information into a new descriptor entry in the system folder list. You need to provide folder descriptors for each folder you wish the Folder Manager to be able to find via the function FindFolder. For example, a child folder located in a parent folder needs to have a descriptor created both for it and its parent folder, so that the child can be found. This function is supported under Mac OS 8 and later.

VERSION NOTES

Supported under Mac OS 8 and later.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)