Function

LSCopyItemInfoForRef(_:_:_:)

Obtains requested information about an item designated by file-system reference.

Declaration

func LSCopyItemInfoForRef(_ inItemRef: UnsafePointer<FSRef>!, _ inWhichInfo: LSRequestedInfo, _ outItemInfo: UnsafeMutablePointer<LSItemInfoRecord>!) -> OSStatus

Parameters

inItemRef

A pointer to a file-system reference designating the item about which information is requested; see the File Manager Reference in the Carbon File Management Documentation for a description of the FSRef data type.

inWhichInfo

Flags specifying what information to obtain; see LSRequestedInfo for a description of these flags.

outItemInfo

A pointer to an item-information record that, on return, will contain the requested information; see LSItemInfoRecord for a description of this structure.

If you request the item’s filename extension (field extension of the item-information record, requested by flag kLSRequestExtension), you are responsible for releasing the Core Foundation string object in which the extension is returned.

Return Value

A result code; see Result Codes.

Discussion

The information obtained about an item can include its filename extension, file type, creator signature, and various item-information flags (indicating, for example, whether the item is an application, or whether it has a hidden extension); see LSItemInfoFlags for a description of these flags.

Version-Notes

Thread-safe since Mac OS version 10.2.

See Also

Obtaining Information About an Item

func LSCopyItemInfoForURL(CFURL!, LSRequestedInfo, UnsafeMutablePointer<LSItemInfoRecord>!) -> OSStatus

Obtains requested information about an item designated by URL.

Deprecated
func LSCopyDisplayNameForRef(UnsafePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Obtains the display name for an item designated by file-system reference.

Deprecated
func LSCopyDisplayNameForURL(CFURL!, UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Obtains the display name for an item designated by URL.

Deprecated
func LSCopyKindStringForRef(UnsafePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Obtains the kind string for an item designated by file-system reference.

Deprecated
func LSCopyKindStringForURL(CFURL!, UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Obtains the kind string for an item designated by URL.

Deprecated
func LSCopyKindStringForTypeInfo(OSType, OSType, CFString!, UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Obtains a kind string for items with a specified file type, creator signature, filename extension, or any combination of these characteristics.

Deprecated