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

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

Re: Reading huge files


From: Eli Zaretskii
Subject: Re: Reading huge files
Date: Wed, 10 Jan 2007 00:03:40 +0200

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




reply via email to

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