[Top][All Lists]

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

Re: read-string!/partial on non-file ports

From: Ludovic Courtès
Subject: Re: read-string!/partial on non-file ports
Date: Tue, 11 Sep 2007 01:19:19 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)


"Luigi Semenzato" <address@hidden> writes:

> I would like to move binary data between two guile
> applications across a pipe (opened with open-input-output-pipe).
> Read-char and write-char in a loop are going to be too slow.
> Read-string!/partial and write-string/partial are exactly what
> I need but they only work on file ports.  (I get this error:
> Wrong type argument in position 2 (expecting open file port):
> #<input-output: soft 56f1d0>).
> Two questions.
> 1. Do I have other choices?  I cannot find any.

Using strings for binary I/O is Bad because it assumes a specific
bit-representation of strings (namely, ASCII).

SRFI-4 vectors and `uniform-vector-read!'/`uniform-vector-write' may be
a better match.

If you're not afraid of using experimental code, you might also want to
try Guile-R6RS-Libs, which includes part of R6RS' binary I/O API
(actually based on R5.92RS):


reply via email to

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