Python: module rox.xattr

rox.xattr | index

`Extended attribute support.
Two versions of the extended attribute API are recognized. If the 'getxattr'
function is detected then the functions used are
getxattr/setxattr/listxattr/removexattr. This is the API found on Linux
and some others.
If the 'attropen' function is found then the functions used are
attropen and unlinkat. This is the API found on Solaris.
If neither version is detected then a set of dummy functions are generated
which have no affect.
You should check the return value of the function supported(). Without
an argument this returns whether extended attribute support is available.
This module requires the ctypes module. This is part of Python 2.5 and
available as an extension for earlier versions of Python.`

Classes
`` |  | exceptions.OSError(exceptions.EnvironmentError) NoXAttr
class NoXAttr(exceptions.OSError)
`` | `Exception thrown when xattr support is requested but is not available.`
| Methods defined here: __init__(self, path)

Functions
`` |  | binary_value_supported() `Returns True if the value of an extended attribute may contain embedded NUL characters (ASCII 0).` delete(path, attr) `Delete an extended attribute from a specified file. path - path name of file to check attr - name of attribute to delete OSError is raised if an error occurs.` get(path, attr) `Get an extended attribute on a specified file. path - path name of file to check attr - name of attribute to get None is returned if the named attribute does not exist. OSError is raised if path does not exist or is not readable.` listx(path) `Return a list of extended attributes set on the named file. path - path name of file to check OSError is raised if path does not exist or is not readable.` name_valid(name) `Check that name is a valid name for an extended attibute. False is returned if the name should not be used.` present(path) `Return True if extended attributes exist on the named file.` set(path, attr, value) `Set an extended attribute on a specified file. path - path name of file to check attr - name of attribute to set value - value of attribute to set OSError is raised if path does not exist or is not writable.` supported(path=None) `Detect whether extended attribute support is available. path - path to file to check for extended attribute support. Availablity can vary from one file system to another. If path is None then return True if the system in general supports extended attributes.`