GNU bug report logs -
#30066
'get-bytevector-some' returns only 1 byte from unbuffered ports
Previous Next
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
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’.
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.