Hacker News new | past | comments | ask | show | jobs | submit login
mmap() files in Common Lisp (wandrian.net)
21 points by wglb on April 8, 2012 | hide | past | favorite | 2 comments



Terrible use-case though. ID3 metadata is a few hundred bytes, all of it in the header. Just use READ-SEQUENCE and be done with it.

  (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)))


You're right, the example isn't a good use case for mmap, but it's just here to show how to use osicat for mmapping :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: