This module allows you to manage extended attributes on files or directories
salt '*' xattr.list /path/to/file
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"
Removes the given attribute from the file
path (str) -- The file(s) to get attributes from
attribute (str) -- The attribute name to be deleted from the file/directory
True if successful, otherwise False
bool
CommandExecutionError on file not found, attribute not found, and any other unknown error
CLI Example:
salt '*' xattr.delete /path/to/file "com.test.attr"
List all of the extended attributes on the given file/directory
path (str) -- The file(s) to get attributes from
hex (bool) -- Return the values with forced hexadecimal values
A dictionary containing extended attributes and values for the given file
dict
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
Read the given attributes on the given file/directory
path (str) -- The file to get attributes from
attribute (str) -- The attribute to read
hex (bool) -- Return the values with forced hexadecimal values
A string containing the value of the named attribute
str
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
Causes the given attribute name to be assigned the given value
path (str) -- The file(s) to get attributes from
attribute (str) -- The attribute name to be written to the file/directory
value (str) -- The value to assign to the given attribute
hex (bool) -- Set the values with forced hexadecimal values
True if successful, otherwise False
bool
CommandExecutionError on file not found or any other unknown error
CLI Example:
salt '*' xattr.write /path/to/file "com.test.attr" "value"