Function

LSCopyItemAttributes(_:_:_:_:)

Obtains multiple item attribute values as a dictionary.

Declaration

func LSCopyItemAttributes(_ inItem: UnsafePointer<FSRef>!, _ inRoles: LSRolesMask, _ inAttributeNames: CFArray!, _ outValues: UnsafeMutablePointer<Unmanaged<CFDictionary>?>!) -> OSStatus

Parameters

inItem

The FSRef of the item to query.

inRoles

The roles. When obtaining attributes related to document binding (such as kLSItemRoleHandlerDisplayName), at least one of the roles must be provided by the application selected. Pass kLSRolesAll if any role is acceptable.

inAttributeNames

A CFArrayRef for an array containing the attribute names to copy. For possible values, see Item Attribute Constants.

outValues

On return, a pointer a CFDictionaryRef for a dictionary whose keys are the attribute names specified by the inAttributeNames parameter and whose values are the attribute’s values. The CFTypeID of each value in the dictionary varies by attribute. See Item Attribute Constants for the data type of each value. If the item does not have a specified attribute, the key for the attribute is not in the dictionary.

Return Value

A result code; see Result Codes.

Discussion

Thread-safe since OS X v10.4.

See Also

Obtaining Information About an Item

func LSCopyItemInfoForRef(UnsafePointer<FSRef>!, LSRequestedInfo, UnsafeMutablePointer<LSItemInfoRecord>!) -> OSStatus

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

Deprecated
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