From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Emacs Lisp - Reading a sequence of bytes as one integer Date: Sat, 13 Mar 2010 20:49:28 +0200 Message-ID: <83vdd012h3.fsf@gnu.org> References: <20100313.115617.104330838.jeff@chaosphere.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1268506201 11662 80.91.229.12 (13 Mar 2010 18:50:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Mar 2010 18:50:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 13 19:49:56 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NqWPK-0001r9-TP for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Mar 2010 19:49:55 +0100 Original-Received: from localhost ([127.0.0.1]:51618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqWPK-00022i-Fz for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Mar 2010 13:49:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqWOt-00021c-6b for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 13:49:27 -0500 Original-Received: from [140.186.70.92] (port=55931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqWOr-00020B-BH for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 13:49:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NqWOp-0001Qz-RF for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 13:49:25 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:52612) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NqWOp-0001Qj-KN for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 13:49:23 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KZ800600HIU5F00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 20:49:21 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.214.230]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KZ800451HM8KC40@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 13 Mar 2010 20:49:21 +0200 (IST) In-reply-to: <20100313.115617.104330838.jeff@chaosphere.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72419 Archived-At: > Date: Sat, 13 Mar 2010 11:56:17 -0500 (EST) > From: Jeff Clough > > I have a (mostly) binary file I want to inspect. There are several > places in this file where I want to read a series of bytes (in this > case, three consecutive bytes) and treat those bytes as a single > integer. I can grab them as a buffer-substring obviously, but I'm at > a loss for how to make that into the integer I need, nor can I find > anything obvious that would be easier. Take a look at bindat.el (it's bundled with Emacs).