lfs_shadow.py 文件源码

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

项目:tm-librarian 作者: FabricAttachedMemory 项目源码 文件源码
def truncate(self, shelf, length, fd):  # shadow_dir, yes an fd
        try:
            if fd:  # It's an open shelf
                assert self[shelf.name]._fd == fd, 'fd mismatch on truncate'
            os.truncate(
                shelf._fd if shelf._fd >= 0 else self.shadowpath(shelf.name),
                length)
            shelf.size_bytes = length
            if shelf.open_handle is None:
                shelf = self[shelf.id]
                if shelf is not None:
                    shelf.size_bytes = length
            return 0
        except OSError as e:
            raise TmfsOSError(e.errno)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号