'Update a console progress bar on this L{StdioClient}\'s transport, based
on the difference between the start time of the operation and the
current time according to the reactor, and appropriate to the size of
the console window.
@param f: a wrapper around the file which is being written or read
@type f: L{FileWrapper}
@param startTime: The time at which the operation being tracked began.
@type startTime: L{float}'

def _printProgressBar(self, f, startTime):

    diff = (self.reactor.seconds() - startTime)
    total = f.total
    try:
        winSize = struct.unpack('4H', fcntl.ioctl(0, tty.TIOCGWINSZ, '12345679'))
    except IOError:
        winSize = [None, 80]
    if (diff == 0.0):
        speed = 0.0
    else:
        speed = (total / diff)
    if speed:
        timeLeft = ((f.size - total) / speed)
    else:
        timeLeft = 0
    front = f.name
    if f.size:
        percentage = ((total / f.size) * 100)
    else:
        percentage = 100
    back = ('%3i%%    %s    %sps    %s    ' % (percentage, self._abbrevSize(total), self._abbrevSize(speed), self._abbrevTime(timeLeft)))
    spaces = ((winSize[1] - ((len(front) + len(back)) + 1)) * '    ')
    command = ('\r%s%s%s' % (front, spaces, back))
    self._writeToTransport(command)
