(self, size=None)
return size
Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
Truncate the file to at most size bytes.
Truncate the file to at most size bytes .
def truncate(self, size=None):
        """Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        """
        self._checkClosed()
        self._checkWritable()
        if size is None:
            size = self.tell()
        os.ftruncate(self._fd, size)
        return size
def truncate ( self , size = None ) : self . _checkClosed ( ) self . _checkWritable ( ) if size is None : size = self . tell ( ) os . ftruncate ( self . _fd , size ) return size