From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: 10 May 2004 10:27:16 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084178119 13265 80.91.224.253 (10 May 2004 08:35:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 May 2004 08:35:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 10 10:35:11 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 1BN6Fj-0000Ap-00 for ; Mon, 10 May 2004 10:35:11 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BN6Ff-0002Ri-00 for ; Mon, 10 May 2004 10:35:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BN68x-0001u8-Si for emacs-devel@quimby.gnus.org; Mon, 10 May 2004 04:28:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.33) id 1BN68d-0001tx-2a for emacs-devel@gnu.org; Mon, 10 May 2004 04:27:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.33) id 1BN687-0001ra-Df for emacs-devel@gnu.org; Mon, 10 May 2004 04:27:50 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BN687-0001rW-6S for emacs-devel@gnu.org; Mon, 10 May 2004 04:27:19 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.33) id 1BN686-0001j7-I8; Mon, 10 May 2004 04:27:19 -0400 Original-To: John Wiegley In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Lines: 27 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:23025 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23025 John Wiegley writes: > The following patch implements a file-handle interface for Emacs Lisp, > which allows files to be directly opened and read/written to without > an intervening buffer. Eshell can now use this, for example, to > greatly speed up output redirection (by several orders of magnitude). > > It is a simple interface that reads in strings, given a length, and > writes strings by examining their length: > > (let ((handle (file-handle-open "/tmp/some-file" "w"))) > (file-handle-write handle "Test data\n") > (file-handle-close handle) > > (setq handle (file-handle-open "/tmp/some-file" "r")) > (message (file-handle-read handle 128)) > (file-handle-close handle)) > > Please post comments here, or mail them to johnw@gnu.org. I had posted a proposal to change start-process instead some time ago that would have allowed for efficient I/O redirection under eshell. Have you seen that proposal? That would be, IMO, a much more Emacsy solution. The above looks like being quite ugly low level. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum