This module allows you to manage extended attributes on files or directories
salt '*' xattr.list /path/to/file
salt.modules.mac_xattr.
clear
(path)¶Causes the all attributes on the file/directory to be removed
path (str) -- The file(s) to get attributes from
True if successful, otherwise False
CommandExecutionError on file not found or any other unknown error
CLI Example:
salt '*' xattr.delete /path/to/file "com.test.attr"
salt.modules.mac_xattr.
delete
(path, attribute)¶Removes the given attribute from the file
True if successful, otherwise False
CommandExecutionError on file not found, attribute not found, and any other unknown error
CLI Example:
salt '*' xattr.delete /path/to/file "com.test.attr"
salt.modules.mac_xattr.
list_
(path, **kwargs)¶List all of the extended attributes on the given file/directory
A dictionary containing extended attributes and values for the given file
CommandExecutionError on file not found or any other unknown error
CLI Example:
salt '*' xattr.list /path/to/file
salt '*' xattr.list /path/to/file hex=True
salt.modules.mac_xattr.
read
(path, attribute, **kwargs)¶Read the given attributes on the given file/directory
A string containing the value of the named attribute
CommandExecutionError on file not found, attribute not found, and any other unknown error
CLI Example:
salt '*' xattr.read /path/to/file com.test.attr
salt '*' xattr.read /path/to/file com.test.attr hex=True
salt.modules.mac_xattr.
write
(path, attribute, value, **kwargs)¶Causes the given attribute name to be assigned the given value
True if successful, otherwise False
CommandExecutionError on file not found or any other unknown error
CLI Example:
salt '*' xattr.write /path/to/file "com.test.attr" "value"