hammerspoon2-docs
    Preparing search index...

    Function xattrGet

    • Get the value of an extended attribute for a file or directory. Attribute values are returned as ISO Latin-1 encoded strings so that arbitrary byte sequences are represented without loss. ASCII text attribute values appear readable as-is.

      Parameters

      • path: string

        Path to the file or directory. ~ is expanded.

      • attribute: string

        Name of the extended attribute.

      • Optionaloptions: string[]

        Array of option strings: "noFollow" (do not follow symlinks), "hfsCompression", "createOnly", "replaceOnly", "noSecurity", "noDefault". Pass an empty array or omit to use no options.

      • Optionalposition: number

        Byte offset within the attribute data. Defaults to 0. Non-zero values are only valid for "com.apple.ResourceFork".

      Returns string | null

      The attribute value as a string, "" if the attribute exists but contains no data, or null if the attribute does not exist or an error occurs.