diff options
author | Bob Ippolito <bob@redivi.com> | 2005-10-08 14:57:02 +0000 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2005-10-08 14:57:02 +0000 |
commit | a1258f9ef7e1c5152841fb1d714b38f3e6b2403d (patch) | |
tree | 487927280d81cf4482172f5bf666dbf1542b07e3 | |
parent | 12f7f09bbcacfcec21478273574e1be4245550da (diff) | |
download | xattr-a1258f9ef7e1c5152841fb1d714b38f3e6b2403d.tar.gz |
compatibility interface
-rw-r--r-- | Lib/xattr/__init__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/xattr/__init__.py b/Lib/xattr/__init__.py index 8e2f774..3ee1ad5 100644 --- a/Lib/xattr/__init__.py +++ b/Lib/xattr/__init__.py @@ -171,3 +171,19 @@ class xattr(object): def items(self): return list(self.iteritems()) + + +def listxattr(f, symlink=False): + return tuple(xattr(f).list(options=symlink and XATTR_NOFOLLOW or 0)) + +def getxattr(f, attr, symlink=False): + return xattr(f).get(options=symlink and XATTR_NOFOLLOW or 0) + +def setxattr(f, attr, value, options=0, symlink=False): + if symlink: + options |= XATTR_NOFOLLOW + return xattr(f).set(attr, value, options=options) + +def removexattr(f, attr, symlink=False): + options = symlink and XATTR_NOFOLLOW or 0 + return xattr(f).remove(attr, options=options) |