Help on module xattr: NAME xattr - Access extended filesystem attributes FILE /home/iusty/work/pyxattr/build/lib.linux-i686-2.3/xattr.so DESCRIPTION This module gives access to the extended attributes present in some operating systems/filesystems. You can list attributes, get, set and remove them. The last and optional parameter for all functions is a boolean value which enables the 'l-' version of the functions - acting on symbolic links and not their destination. Example: >>> import xattr >>> xattr.listxattr("file.txt") ('user.mime_type',) >>> xattr.getxattr("file.txt", "user.mime_type") 'text/plain' >>> xattr.setxattr("file.txt", "user.comment", "Simple text file") >>> xattr.listxattr("file.txt") ('user.mime_type', 'user.comment') >>> xattr.removexattr ("file.txt", "user.comment") FUNCTIONS getxattr(...) Get the value of a given extended attribute. Parameters: - a string representing filename, or a file-like object, or a file descriptor; this represents the file on which to act - a string, representing the attribute whose value to retrieve; usually in form of system.posix_acl or user.mime_type - (optional) a boolean value (defaults to false), which, if the file name given is a symbolic link, makes the function operate on the symbolic link itself instead of its target; listxattr(...) Return the tuple of attribute names from a file Parameters: - a string representing filename, or a file-like object, or a file descriptor; this represents the file to be queried - (optional) a boolean value (defaults to false), which, if the file name given is a symbolic link, makes the function operate on the symbolic link itself instead of its target; removexattr(...) Remove an attribute from a file Parameters: - a string representing filename, or a file-like object, or a file descriptor; this represents the file on which to act - a string, representing the attribute to be removed; usually in form of system.posix_acl or user.mime_type - (optional) a boolean value (defaults to false), which, if the file name given is a symbolic link, makes the function operate on the symbolic link itself instead of its target; setxattr(...) Set the value of a given extended attribute. Be carefull in case you want to set attributes on symbolic links, you have to use all the 5 parameters; use 0 for the flags value if you want the default behavior (create or replace) Parameters: - a string representing filename, or a file-like object, or a file descriptor; this represents the file on which to act - a string, representing the attribute whose value to set; usually in form of system.posix_acl or user.mime_type - a string, possibly with embedded NULLs; note that there are restrictions regarding the size of the value, for example, for ext2/ext3, maximum size is the block size - (optional) flags; if 0 or ommited the attribute will be created or replaced; if XATTR_CREATE, the attribute will be created, giving an error if it already exists; of XATTR_REPLACE, the attribute will be replaced, giving an error if it doesn't exists; - (optional) a boolean value (defaults to false), which, if the file name given is a symbolic link, makes the function operate on the symbolic link itself instead of its target; DATA XATTR_CREATE = 1 XATTR_REPLACE = 2