Function

LSCopyDisplayNameForURL(_:_:)

Obtains the display name for an item designated by URL.

Declaration

func LSCopyDisplayNameForURL(_ inURL: CFURL!, _ outDisplayName: UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Parameters

inFileURL

A Core Foundation URL reference designating the item whose display name is requested; see the CFURL Reference in the Core Foundation Reference Documentation for a description of the CFURLRef data type. The URL must have scheme file and contain a valid path to either a file or a directory.

outDisplayName

A pointer to a Core Foundation string object that, on return, will contain the item’s display name; see the CFString Reference in the Core Foundation Reference Documentation for a description of the CFStringRef data type. You are responsible for releasing this object.

Return Value

A result code; see Result Codes.

Discussion

The item’s display name is returned in the form in which it will appear on the user’s screen; it may be localized (for applications and folders), and it excludes the filename extension if the extension is set to be hidden and the Finder preference to always show extensions is not enabled.

Version-Notes

Thread-safe since Mac OS version 10.2.

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 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