file_manager.py 文件源码

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

项目:solaris-ips 作者: oracle 项目源码 文件源码
def remove(self, hashval):
                """This function removes the file associated with the name
                "hashval"."""

                if self.readonly:
                        raise NeedToModifyReadOnlyFileManager(hashval,
                            "remove")
                for l in self.layouts:
                        cur_path = l.lookup(hashval)
                        cur_full_path = os.path.join(self.root, cur_path)
                        try:
                                portable.remove(cur_full_path)
                                os.removedirs(os.path.dirname(cur_full_path))
                        except EnvironmentError as e:
                                if e.errno == errno.ENOENT or \
                                    e.errno == errno.EEXIST:
                                        pass
                                elif e.errno == errno.EACCES or \
                                    e.errno == errno.EROFS:
                                        raise FMPermissionsException(e.filename)
                                else:
                                        raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号