bug-guile
[Top][All Lists]
Advanced

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

bug#30066: 'get-bytevector-some' returns only 1 byte from unbuffered por


From: Ludovic Courtès
Subject: bug#30066: 'get-bytevector-some' returns only 1 byte from unbuffered ports
Date: Wed, 10 Jan 2018 16:02:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

As discussed on IRC, ‘get-bytevector-some’ returns only 1 byte from
unbuffered ports:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (call-with-input-string "foo"
                       (lambda (port)
                         (setvbuf port _IONBF)
                         (get-bytevector-some port)))
$11 = #vu8(102)
scheme@(guile-user)> (version)
$12 = "2.2.3"
--8<---------------cut here---------------end--------------->8---

Strictly speaking it’s valid, but in practice it’s not very useful.

AFAICS, we lack a way to do the equivalent of:

  read (fd, buf, sizeof buf);

‘get-bytevector-n!’ is different because it blocks until it has read
COUNT bytes or EOF is reached.  So ‘get-bytevector-some’ could play this
role, but it doesn’t.

Thoughts?

Ludo’.





reply via email to

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