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: opening large files (few hundred meg) Date: Thu, 31 Jan 2008 00:04:02 +0200 Message-ID: References: <1f94fef6-a335-4ce5-8d4b-7e87025a28dc@e32g2000prn.googlegroups.com> <87r6g1esga.fsf@gmx.de> <2adae7bb-c775-4a6e-bf83-66a8618b326d@s12g2000prg.googlegroups.com> <87ejc1m21x.fsf@lion.rapttech.com.au> <36295bce-c40b-4faf-ae7d-04eb90796da8@q39g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1201730757 19719 80.91.229.12 (30 Jan 2008 22:05:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 22:05:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 30 23:06:17 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 1JKL4H-0002ZL-3e for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 23:06:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKL3q-0007vy-1t for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 17:05:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKL3U-0007t3-G6 for help-gnu-emacs@gnu.org; Wed, 30 Jan 2008 17:05:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKL3T-0007sX-Lw for help-gnu-emacs@gnu.org; Wed, 30 Jan 2008 17:05:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKL3T-0007sT-9C for help-gnu-emacs@gnu.org; Wed, 30 Jan 2008 17:05:15 -0500 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JKL3S-00009U-Lj for help-gnu-emacs@gnu.org; Wed, 30 Jan 2008 17:05:14 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-45-178.inter.net.il [80.230.45.178]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id JAE89702 (AUTH halo1); Thu, 31 Jan 2008 00:01:36 +0200 (IST) In-reply-to: (message from Stefan Monnier on Wed, 30 Jan 2008 15:01:44 -0500) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:51105 Archived-At: > From: Stefan Monnier > Date: Wed, 30 Jan 2008 15:01:44 -0500 > > >> Perhaps you could process the file in chunks, using the optional args > >> to insert-file-contents to put subsets of the file into a buffer. > >> I haven't tried this myself, so I am not even sure it would work. > > > No need to try: it won't work. As I wrote earlier in this thread, the > > problem is that Emacs cannot address offsets into the buffer larger > > than 0.5 gig, and this problem will cause the arguments to > > insert-file-contents to overflow exactly like when you read the entire > > file. > > You don't have to use the built in limits of insert-file-contents: you > can extract parts of the file using `dd' first (using Elisp floats to > represent the larger integers). I was responding to a suggestion to use the optional args of insert-file-contents to slice the file. There are lots of other ways of doing that, but they are unrelated to insert-file-contents being able to read just a portion of a file, and to my response which you quote. > Also it'd be easy enough to extend insert-file-contents (at the C level) > to accept float values for BEG and END (or pairs of integers) so as to > be able to represent larger values. One can hack Emacs to do anything -- this is Free Software, after all. But the OP wanted a way to visit large files without any hacking, just by using existing facilities.