Carbon


FSCatalogInfo

Header: Files.h

Holds basic information about a file or directory.

struct FSCatalogInfo {
    UInt16 nodeFlags; 
    FSVolumeRefNum volume; 
    UInt32 parentDirID; 
    UInt32 nodeID; 
    UInt8 sharingFlags; 
    UInt8 userPrivileges; 
    UInt8 reserved1; 
    UInt8 reserved2; 
    UTCDateTime createDate; 
    UTCDateTime contentModDate; 
    UTCDateTime attributeModDate; 
    UTCDateTime accessDate; 
    UTCDateTime backupDate; 
    UInt32 permissions[4]; 
    UInt8 finderInfo[16]; 
    UInt8 extFinderInfo[16]; 
    UInt64 dataLogicalSize; 
    UInt64 dataPhysicalSize; 
    UInt64 rsrcLogicalSize; 
    UInt64 rsrcPhysicalSize; 
    UInt32 valence; 
    TextEncoding textEncodingHint;
};
typedef FSCatalogInfo FSCatalogInfoPtr;

Field descriptions

nodeFlags

Node flags. This field has two defined bits that indicate whether an object is a file or folder, and whether a file is locked (constants kFSNodeIsDirectoryMask and kFSNodeLockedMask).

volume

The object's volume reference.

parentDirID

The ID of the directory that contains the given object. The root directory of a volume always has ID fsRtDirID (2); the parent of the root directory is ID fsRtParID (1). Note that there is no object with ID fsRtParID; this is merely used when the File Manager is asked for the parent of the root directory.

nodeID

The file or directory ID.

sharingFlags

The object’s sharing flags. Currently the constants kioFlAttribMountedBit and kioFlAttribSharePointBit are defined for this field.

userPrivileges

The user's effective AFP privileges (same as ioACUser in the old HFileInfo and DirInfo structures).

reserved1

Reserved.

reserved2

Reserved.

createDate

The date and time of the creation of the object.

contentModDate

The date and time that the data or resource fork was last modified.

attributeModDate

The date and time that an attribute of the object (such as a fork other than the data or resource fork) was last modified.

accessDate

The date and time that the object was last accessed. The Mac OS 8 File Manager does not automatically update the accessDate field; it exists primarily for use by other operating systems (notably Mac OS X).

backupDate

The date and time of the object’s last backup. This field is not updated by the File Manager; a backup utility may use this field if it wishes.

permissions

User and group permission information. The Mac OS 8 File Manager does not use or enforce this permission information. It could be used by a file server program or other operating system (such as Mac OS X).

finderInfo

Finder information part 1: basic Finder information for the object. This information is available in the catalog info, instead of a named fork, for historical reasons. The File Manager does not interpret the contents of these fields.

extFinderInfo

Finder information part 2: extended Finder information for the object. This information is available in the catalog info, instead of a named fork, for historical reasons. The File Manager does not interpret the contents of these fields.

dataLogicalSize

This field is for files only. The size of the data fork in bytes.

dataPhysicalSize

This field is for files only. The amount of disk space (in bytes) occupied by the data fork.

rsrcLogicalSize

This field is for files only. The size of the resource fork.

rsrcPhysicalSize

This field is for files only. The amount of disk space occupied by the resource fork.

valence

This field if for folders only; it is used for directories. It is the number of items (files plus directories) contained within the directory. For files, it is set to zero. Many volume formats do not store a field containing a directory’s valence. For those volume formats, this field is very expensive to compute. Think carefully before you ask the File Manager to return this field.

textEncodingHint

The textEncodingHint field is used in conjunction with the Unicode filename. It is an optional hint that can be used by the volume format when converting the Unicode to some other encoding. For example, HFS Plus stores this value and uses it when converting the name to a Mac OS encoding, such as when the name is returned by PBGetCatInfo. As another example, HFS volumes use this value to convert the Unicode name to a Mac OS encoded name stored on disk. If the entire Unicode name can be converted to a single Mac OS encoding, then that encoding should be used as the textEncodingHint; otherwise, a text encoding corresponding to the first characters of the name will probably provide the best user experience. If a textEncodingHint is not supplied when a file or directory is created or renamed, the volume format will use a default value. This default value may not be the best possible choice for the given filename. Whenever possible, a client should supply a textEncodingHint.

The FSCatalogInfoBitmap type is used to indicate which fields of the FSCatalogInfo should be set or retrieved. If the bit corresponding to a particular field is not set, then that field is not changed if the FSCatalogInfo is an output parameter, and that field is ignored if the FSCatalogInfo is an input parameter.


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