code: def truncate(self, path, size):
          
          path = self._adjust_cwd(path)
          self._log(DEBUG, "truncate({!r}, {!r})".format(path, size))
          attr = SFTPAttributes()
          attr.st_size = size
          self._request(CMD_SETSTAT, path, attr)
docs: Change the size of the file specified by ``path``.  This usually
          extends or shrinks the size of the file, just like the `~file.truncate`
          method on Python file objects.
  
          :param str path: path of the file to modify
          :param int size: the new size of the file