salt.modules.mac_xattr
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
- Parameters
-
path (str) -- The file(s) to get attributes from
- Returns
-
True if successful, otherwise False
- Raises
-
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.clear(path)
-
Removes the given attribute from the file
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
- Raises
-
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.delete(path, attribute)
-
List all of the extended attributes on the given file/directory
- Parameters
- Returns
-
A dictionary containing extended attributes and values for the given file
- Return type
- Raises
-
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.list_(path, **kwargs)
-
Read the given attributes on the given file/directory
- Parameters
- Returns
-
A string containing the value of the named attribute
- Return type
- Raises
-
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.read(path, attribute, **kwargs)
-
Causes the given attribute name to be assigned the given value
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
- Raises
-
CommandExecutionError on file not found or any other unknown error
CLI Example:
salt '*' xattr.write /path/to/file "com.test.attr" "value"
salt.modules.mac_xattr.write(path, attribute, value, **kwargs)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.mac_xattr.html