Contents

getXattr(named:of:replyHandler:)

Gets the specified extended attribute of the given item.

Declaration

func getXattr(named name: FSFileName, of item: FSItem, replyHandler reply: @escaping  @Sendable (Data?, (any Error)?) -> Void)
func xattr(named name: FSFileName, of item: FSItem) async throws -> Data

Parameters

  • name:

    The extended attribute name.

  • item:

    The item for which to get the extended attribute.

  • reply:

    A block or closure to indicate success or failure. If getting the attribute succeeds, pass an data instance containing the extended attribute data and a nil error. If getting the attribute fails, pass the relevant error as the second parameter; FSKit ignores any data in this case. For an async Swift implementation, there’s no reply handler; simply return the data or throw an error.

See Also

Reading and writing