On this page:
make-byte-counting-port
Version: 5.0

26 Byte Counting Ports

Jay McCarthy <jay@racket-lang.org>

 (require unstable/byte-counting-port)

This library is unstable; compatibility will not be maintained. See Unstable for more information.

This library provides an output port constructor like open-output-nowhere, except it counts how many bytes have been written (available through file-position.)

(make-byte-counting-port [name])  output-port?
  name : any/c = 'byte-counting-port
Creates and returns an output port that discards all output sent to it (without blocking.) The name argument is used as the port’s name. The total number bytes written is available through file-position.