(use-modules (rnrs bytevectors) (ice-9 binary-ports)) (define MAX_SIGNED_INT 2147483647) (define BYTES_TO_READ 10) (define (traverse port) (let* ((file-sz (stat:size (stat port))) (ua (make-bytevector BYTES_TO_READ 0)) (cur-offset 0)) (let lp ((cur-offset (seek port (- MAX_SIGNED_INT 1000) SEEK_CUR))) (when (< cur-offset (- file-sz BYTES_TO_READ)) (lp (seek port BYTES_TO_READ SEEK_CUR)))) (close-port port))) (define port (mkstemp! (string-copy "/tmp/big-file-XXXXXX"))) (truncate-file port #e2.5e9) (traverse port)