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: Reading huge files Date: Wed, 10 Jan 2007 00:03:40 +0200 Message-ID: References: <8642ba650701081417n3c658d33v6dbf743a9bd30c7c@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1168380241 25763 80.91.229.12 (9 Jan 2007 22:04:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Jan 2007 22:04:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 09 23:03:59 2007 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 1H4P4X-0004Qu-PJ for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Jan 2007 23:03:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4P4W-0007MB-OW for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Jan 2007 17:03:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H4P4H-0007Kb-7h for help-gnu-emacs@gnu.org; Tue, 09 Jan 2007 17:03:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H4P4D-0007J3-9Q for help-gnu-emacs@gnu.org; Tue, 09 Jan 2007 17:03:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4P4D-0007Iy-6D for help-gnu-emacs@gnu.org; Tue, 09 Jan 2007 17:03:37 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H4P4C-0000Gg-JR for help-gnu-emacs@gnu.org; Tue, 09 Jan 2007 17:03:36 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-122-127.inter.net.il [84.229.122.127]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id GTV11448 (AUTH halo1); Wed, 10 Jan 2007 00:03:34 +0200 (IST) Original-To: help-gnu-emacs@gnu.org In-reply-to: (message from Kevin Rodgers on Tue, 09 Jan 2007 08:24:52 -0700) 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:40198 Archived-At: > From: Kevin Rodgers > 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?