hammerspoon2-docs
    Preparing search index...

    Function xattrSet

    • Set the value of an extended attribute for a file or directory. The value is written as ISO Latin-1 bytes, providing a lossless round-trip with xattrGet. Plain ASCII strings work directly without any encoding.

      Parameters

      • path: string

        Path to the file or directory. ~ is expanded.

      • attribute: string

        Name of the extended attribute.

      • value: string

        The value to write.

      • Optionaloptions: string[]

        Array of option strings: "noFollow", "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 boolean

      true on success, false on failure.