@classdef.method("truncate", length="int")
    def method_truncate(self, space, length):
        self.ensure_not_closed(space)
        try:
            ftruncate(self.fd, length)
        except __HOLE__ as e:
            raise error_for_oserror(space, e)
        return space.newint(0)
dataset/ETHPy150Open topazproject/topaz/topaz/objects/fileobject.py/W_FileObject.method_truncate