ops.py 文件源码

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

项目:tfhfs 作者: fingon 项目源码 文件源码
def rmdir(self, parent_inode, name, ctx):
        assert self._initialized
        assert_or_errno(self.access(parent_inode, WX_OK, ctx),
                        EPERM, 'no wx perm to parent inode')
        pn = self.forest.inodes.get_by_value(parent_inode)
        n = self._lookup(pn, name, ctx)
        assert_or_errno(n, ENOENT, 'no entry in tree')
        try:
            assert_or_errno(n.leaf_node.is_dir, ENOENT, 'non-directory target')
            self._ctx_sticky_mutate_check(ctx, pn, n)
            assert_or_errno(not n.node.children, ENOTEMPTY)
            n.leaf_node.root.remove_from_tree(n.leaf_node)
            pn.change_times()
            # TBD: Also check the subdir permission?
        finally:
            n.deref()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号