From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Efficiently checking the initial contents of a file Date: Fri, 16 May 2008 03:16:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5f8b772a-e2ed-468c-89b3-2d9e40ed132b@m3g2000hsc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1210934560 10034 80.91.229.12 (16 May 2008 10:42:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2008 10:42:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 16 12:43:15 2008 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.50) id 1JwxOY-0008ED-DL for geh-help-gnu-emacs@m.gmane.org; Fri, 16 May 2008 12:42:38 +0200 Original-Received: from localhost ([127.0.0.1]:45274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwxNo-000775-L5 for geh-help-gnu-emacs@m.gmane.org; Fri, 16 May 2008 06:41:53 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!m3g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 12 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1210932973 13635 127.0.0.1 (16 May 2008 10:16:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 16 May 2008 10:16:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m3g2000hsc.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en; rv:1.8.1.14) Gecko/20080418 Epiphany/2.20 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Original-Xref: news.stanford.edu gnu.emacs.help:158686 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:54047 Archived-At: How can I efficiently using pure emacs-lisp (without calling any external process) investigate the first bytes of a file? My guess is - Open parts of the file into a buffer or string. - Alt 1. Switch to the buffer and do things. Alt 2. Or do stuff directly the string? Which operations should be performed via a buffer and which should operate on a string? /Nordl=F6w