Contents

LSCopyDisplayNameForRef(_:_:)

Obtains the display name for an item with a file-system reference.

Declaration

func LSCopyDisplayNameForRef(_ inRef: UnsafePointer<FSRef>!, _ outDisplayName: UnsafeMutablePointer<Unmanaged<CFString>?>!) -> OSStatus

Parameters

  • inRef:

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

  • 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

Deprecated Functions