[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading data from a file descriptor
From: |
Chris Vine |
Subject: |
Re: Reading data from a file descriptor |
Date: |
Tue, 17 Nov 2015 13:55:17 +0000 |
On Tue, 17 Nov 2015 13:52:21 +0100
<address@hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Nov 17, 2015 at 12:59:56PM +0000, Chris Vine wrote:
> > On Tue, 17 Nov 2015 10:53:19 +0100
>
> [...]
>
> > guile's R6RS implementation has get-bytevector-some, which will do
> > that for you, with unix-read-like behaviour.
>
> Thank you a thousand. You made me happy :-)
I suppose it is worth adding that it might not be optimally efficient
for all uses, as there is no get-bytevector-some! procedure which
modifies an existing bytevector and takes a maximum length value. I
guess it is a matter of 'suck it and see', efficiency-wise.
If you are sending/receiving binary packets, it might be better to make
them of fixed size and use get-bytevector-n!. (Unfortunately,
get-bytevector-n! does block until n is fulfilled according to R6RS:
"The get-bytevector-n! procedure reads from binary-input-port, blocking
as necessary, until count bytes are available from binary-input-port or
until an end of file is reached".)
Chris
- Re: Reading data from a file descriptor, (continued)
- Re: Reading data from a file descriptor, Jan Synáček, 2015/11/09
- Re: Reading data from a file descriptor, Mark H Weaver, 2015/11/13
- Re: Reading data from a file descriptor, Jan Synáček, 2015/11/13
- Re: Reading data from a file descriptor, Thompson, David, 2015/11/13
- Re: Reading data from a file descriptor, Jan Synáček, 2015/11/16
- Re: Reading data from a file descriptor, Thompson, David, 2015/11/16
- Re: Reading data from a file descriptor, Amirouche Boubekki, 2015/11/16
- Re: Reading data from a file descriptor, tomas, 2015/11/17
- Re: Reading data from a file descriptor, Chris Vine, 2015/11/17
- Re: Reading data from a file descriptor, tomas, 2015/11/17
- Re: Reading data from a file descriptor,
Chris Vine <=
- Re: Reading data from a file descriptor, tomas, 2015/11/17
- Re: Reading data from a file descriptor, Jan Synáček, 2015/11/18
- Re: Reading data from a file descriptor, tomas, 2015/11/16
- Re: Reading data from a file descriptor, Andreas Rottmann, 2015/11/23
- Re: Reading data from a file descriptor, tomas, 2015/11/24