path.py 文件源码

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

项目:alicloud-duplicity 作者: aliyun 项目源码 文件源码
def setdata(self):
        """Refresh stat cache"""
        try:
            # We may be asked to look at the target of symlinks rather than
            # the link itself.
            if globals.copy_links:
                self.stat = os.stat(self.name)
            else:
                self.stat = os.lstat(self.name)
        except OSError as e:
            err_string = errno.errorcode[e[0]]
            if err_string in ["ENOENT", "ENOTDIR", "ELOOP", "ENOTCONN"]:
                self.stat, self.type = None, None  # file doesn't exist
                self.mode = None
            else:
                raise
        else:
            self.set_from_stat()
            if self.issym():
                self.symtext = os.readlink(self.name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号