From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: help editing huge files in emacs Date: Tue, 21 Mar 2006 11:27:44 -0500 Organization: Bell Sympatico Message-ID: <87slpbg43n.fsf-monnier+gnu.emacs.help@gnu.org> References: <87hd605jlx.fsf-monnier+gnu.emacs.help@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143481601 27529 80.91.229.2 (27 Mar 2006 17:46:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2006 17:46:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 27 19:46:34 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FNvmg-0003Jr-Mt for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Mar 2006 19:45:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNvmg-0003Zt-0N for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Mar 2006 12:45:42 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!usenet01.sei.cmu.edu!nn.andrew.cmu.edu!pitt.edu!newsflash.concordia.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:M4H3MRXcr0oinSfPAccr5sPNYT8= Original-Lines: 30 Original-NNTP-Posting-Host: 70.55.140.81 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1142958465 70.55.140.81 (Tue, 21 Mar 2006 11:27:45 EST) Original-NNTP-Posting-Date: Tue, 21 Mar 2006 11:27:45 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:138299 Original-To: help-gnu-emacs@gnu.org 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:34011 Archived-At: >> > How can I edit a selected number of lines in a 4GB file in Emacs >> > without open the whole file? Is it possible? >> >> `insert-file-contents' takes two integer parameters BEG and END to allow >> getting only part of a file into a buffer. The corresponding `write-region' >> takes an APPEND parameter which can be an integer indicating at which >> position in the file the text should be written. > ??? But aren't those parameters limited to EMACS_INT max values, Yes. > i.e. to the same number of less-than-32 bits that limits the maximum > size of an Emacs buffer? Or am I missing something? He didn't say why he didn't want to open the whole file. And he didn't say that he was using a 32bit system. In my exprience the 128MB file size limit (aka 256MB in Emacs-CVS, 512MB with my local hack, and 1GB with XEmacs) is not the only reason why I wouldn't want to open directly such a large file. Manipulating large buffers isn't Emacs's forte. > If I'm right, then editing of a 4GB file using your suggestions is > possible only in a 64-bit build of Emacs. Indeed. Although if there's enough interest it'd be easy to extend insert-file-contents and write-region to accept floats as well so as to push this limit a good bit further even on 32bit systems. Stefan