def write_to_rp(self, rp):
"""Write extended attributes to rpath rp"""
self.clear_rp(rp)
for (name, value) in self.attr_dict.iteritems():
try:
rp.conn.xattr.setxattr(encode(rp.path), name,
value, 0, rp.issym())
except IOError, exc:
# Mac and Linux attributes have different namespaces, so
# fail gracefully if can't call setxattr
if exc[0] in (errno.EOPNOTSUPP, errno.EPERM, errno.EACCES,
errno.ENOENT, errno.EINVAL):
log.Log("Warning: unable to write xattr %s to %s"
% (name, repr(rp.path)), 6)
continue
else: raise
评论列表
文章目录