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

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

Re: Reading huge files


From: Kevin Rodgers
Subject: Re: Reading huge files
Date: Wed, 10 Jan 2007 23:30:23 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Eli Zaretskii wrote:
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
Date: Tue, 09 Jan 2007 08:24:52 -0700

(defun view-large-file-contents (file beg end)
   "View FILE contents from bytes BEG through END, in View mode."
   (interactive "fView file: \nnFrom byte: \nnTo byte: ")
   (switch-to-buffer
    (generate-new-buffer (format "%s[%d,%d]"
                                (file-name-nondirectory file) beg end)))
   (insert-file-contents file nil beg end)
   (view-mode 1))

Does this really work?  I think it won't: the underlying problem is
that for large files, END overflows the limits of the ELisp integer
type, and your suggestion doesn't resolve this fundamental problem.
So insert-file-contents will still barf with large files.

Or am I missing something?

No, you are far wiser in the ways of the buddha.

Why does insert-file-contents signal an error if you pass floating point
values for BEG and END?

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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