LSCopyItemInfoForURL(_:_:_:)
Obtains requested information about an item with a URL.
Declaration
func LSCopyItemInfoForURL(_ inURL: CFURL!, _ inWhichInfo: LSRequestedInfo, _ outItemInfo: UnsafeMutablePointer<LSItemInfoRecord>!) -> OSStatusParameters
- inFileURL:
A Core Foundation URL reference designating the item about which information is requested; see the CFURL Reference in the Core Foundation Reference Documentation for a description of the
CFURLRefdata type. The URL must have schemefileand contain a valid path to either a file or a directory. - 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
extensionof the item-information record, requested by flagkLSRequestExtension), 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
Deprecated Functions
LSGetHandlerOptionsForContentType(_:)LSSetHandlerOptionsForContentType(_:_:)LSCopyAllHandlersForURLScheme(_:)LSCopyDefaultHandlerForURLScheme(_:)LSGetApplicationForItem(_:_:_:_:)LSGetApplicationForURL(_:_:_:_:)LSGetApplicationForInfo(_:_:_:_:_:_:)LSCopyApplicationForMIMEType(_:_:_:)LSCanRefAcceptItem(_:_:_:_:_:)LSFindApplicationForInfo(_:_:_:_:_:)LSOpenApplication(_:_:)LSOpenItemsWithRole(_:_:_:_:_:_:_:)LSOpenURLsWithRole(_:_:_:_:_:_:)LSOpenFSRef(_:_:)LSOpenFromRefSpec(_:_:)LSCopyItemInfoForRef(_:_:_:)LSCopyDisplayNameForRef(_:_:)LSCopyDisplayNameForURL(_:_:)LSCopyKindStringForRef(_:_:)LSCopyKindStringForURL(_:_:)LSCopyKindStringForTypeInfo(_:_:_:_:)LSCopyKindStringForMIMEType(_:_:)LSCopyItemAttribute(_:_:_:_:)LSCopyItemAttributes(_:_:_:_:)LSGetExtensionInfo(_:_:_:)LSSetExtensionHiddenForRef(_:_:)LSSetExtensionHiddenForURL(_:_:)LSRegisterFSRef(_:_:)