Kevin Rodgers a écrit : > Xavier Maillard wrote: > > Where iactually fail is at reading binary data from the file and > > packing binary data into a more "neutral" format based on sexp. > > > > Do you know any pack/unpack-like functions for GNU Emacs ? > > Are you familiar with Emacs coding systems? Yes I do and the problem is not with reading binary data but with "mapping" bytes into something that reflect the binary file format (header, data, ...). In perl you have two valuable functions called pack and unpack that takes a string and expands it out into a list of values. This is what I am looking for in emacs lisp. So is there anything similar ? Regards, Xavier P.S: here is what I am ending up for reading (temporary and subject to change. It basically load a file and try to read the first 72 bytes from there (corresponding to the file header) (defun load-memodb (file-name) (save-excursion (set-buffer (create-file-buffer file-name)) (erase-buffer) (if (fboundp 'set-buffer-multibyte) (set-buffer-multibyte t)) (let ((coding-system-for-read 'binary)) (insert-file-contents file-name)) (goto-char (point-min)) (setq header (memo-read-bytes 72))))