help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help editing huge files in emacs


From: Stefan Monnier
Subject: Re: help editing huge files in emacs
Date: Tue, 21 Mar 2006 11:27:44 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> > 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]