;; terribly inefficient, from osxattr egg (define (char x) (integer->char (bitwise-and x 255))) (define (write-u32 x) (write-char (char (arithmetic-shift x -24))) (write-char (char (arithmetic-shift x -16))) (write-char (char (arithmetic-shift x -8))) (write-char (char x))) ;; (write-u32 #x61626364) ;; abcd ;; equivalent definition of write-u32 that should also work (define (write-u32 x) (display (string (char (arithmetic-shift x -24))) (char (arithmetic-shift x -16))) (char (arithmetic-shift x -8))) (char x))))