[Top][All Lists]

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

Re: request for review: Doing direct file I/O in Emacs Lisp

From: David Kastrup
Subject: Re: request for review: Doing direct file I/O in Emacs Lisp
Date: 10 May 2004 10:27:16 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

John Wiegley <address@hidden> 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 address@hidden

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

reply via email to

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