mmap() files in Common Lisp
wandrian.net
wandrian.net
(defun read-n-bytes (path &optional (n 512))
(with-open-file (fd path :element-type '(unsigned-byte 8))
(let ((header (make-array n)))
(read-sequence header fd)
header)))