GNU bug report logs - #30066
'get-bytevector-some' returns only 1 byte from unbuffered ports

Previous Next

Package: guile;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Wed, 10 Jan 2018 15:03:02 UTC

Severity: normal

Tags: notabug

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo <at> igalia.com>
Cc: Mark H Weaver <mhw <at> netris.org>, 30066 <at> debbugs.gnu.org
Subject: bug#30066: 'get-bytevector-some' returns only 1 byte from unbuffered ports
Date: Fri, 12 Jan 2018 11:15:08 +0100
Andy Wingo <wingo <at> igalia.com> skribis:

> On Thu 11 Jan 2018 22:55, Mark H Weaver <mhw <at> netris.org> writes:

[...]

>>>> Out of curiosity, is there a reason why you're using an unbuffered port
>>>> in your use case?
>>>
>>> It’s to implement redirect à la socat:
>>>
>>>   https://git.savannah.gnu.org/cgit/guix.git/commit/?id=17af5d51de7c40756a4a39d336f81681de2ba447
>>
>> Why is an unbuffered port being used here?  Can we change it to a
>> buffered port?
>
> This was also a question I had!  If you make it a buffered port at 4096
> bytes (for example), then get-bytevector-some works exactly like you
> want it to, no?

It might work, but that’s more by chance no?

I mean, if we declare the port as buffered, then we give the I/O
routines the “right” to fill in that buffer.

WDYT?

Thanks,
Ludo’.




This bug report was last modified 7 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.