gfapi.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:gkube 作者: guohongze 项目源码 文件源码
def setxattr(self, path, key, value, flags=0):
        """
        Set extended attribute of the path.

        :param path: Path to file or directory.
        :param key: The key of extended attribute.
        :param value: The valiue of extended attribute.
        :param flags: Possible values are 0 (default), 1 and 2
                      0: xattr will be created if it does not exist, or the
                         value will be replaced if the xattr exists.
                      1: Perform a pure create, which fails if the named
                         attribute already exists.
                      2: Perform a pure replace operation, which fails if the
                         named attribute does not already exist.
        """
        ret = api.glfs_setxattr(self.fs, path, key, value, len(value), flags)
        if ret < 0:
            err = ctypes.get_errno()
            raise OSError(err, os.strerror(err))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号