From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: Fri, 14 May 2004 17:02:35 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084569622 19399 80.91.224.253 (14 May 2004 21:20:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 May 2004 21:20:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 14 23:20:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOk6K-0006TX-00 for ; Fri, 14 May 2004 23:20:16 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOk6K-00007c-00 for ; Fri, 14 May 2004 23:20:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOk4f-0000Xc-T8 for emacs-devel@quimby.gnus.org; Fri, 14 May 2004 17:18:33 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BOjqF-00058D-1t for emacs-devel@gnu.org; Fri, 14 May 2004 17:03:39 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOjpE-0004os-7T for emacs-devel@gnu.org; Fri, 14 May 2004 17:03:08 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOjpD-0004oo-W2 for emacs-devel@gnu.org; Fri, 14 May 2004 17:02:36 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BOjpD-000769-Fk; Fri, 14 May 2004 17:02:35 -0400 Original-To: John Wiegley In-reply-to: (message from John Wiegley on Thu, 13 May 2004 15:50:23 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23424 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23424 Requiring all data to pass through a buffer, in order to save it to disk, is difficult to handle efficiently. Because the whole file must be stored in the buffer before being saved, write-region can append to a file. That's probably the easiest way to handle eshell builtins. write-region can also append the contents of a string. So you don't have to construct the builtin's output in a buffer--you can do it in a string. However, a buffer will be more efficient in most cases.