Contents

LSGetExtensionInfo(_:_:_:)

Obtains the starting index of the extension within a filename.

Declaration

func LSGetExtensionInfo(_ inNameLen: Int, _ inNameBuffer: UnsafePointer<UniChar>!, _ outExtStartIndex: UnsafeMutablePointer<Int>!) -> OSStatus

Parameters

  • inNameLen:

    The number of characters in the filename specified by the inNameBuffer parameter.

  • inNameBuffer:

    The buffer containing the filename’s Unicode characters.

  • outExtStartIndex:

    A pointer to a value of type UniCharCount that, on return, will give the starting index of the extension within the filename. If the name does not contain a valid extension (one with no spaces in it), the value on return will be kLSInvalidExtensionIndex.

Return Value

A result code; see Result Codes.

Discussion

The starting index is the number of Unicode characters from the start of the filename buffer to the first character of the extension (not including the period).

Version-Notes

Thread-safe since Mac OS version 10.2.

See Also

Deprecated Functions