GNU bug report logs - #20302
peek-char messes up file position on binary string ports

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Sat, 11 Apr 2015 11:49:02 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: David Kastrup <dak <at> gnu.org>
To: 20302 <at> debbugs.gnu.org
Subject: bug#20302: peek-char messes up file position on binary string ports
Date: Sat, 11 Apr 2015 13:48:14 +0200
[Message part 1 (text/plain, inline)]
Any idea how to work around _this_ one?

[gaga.scm (text/plain, inline)]
(use-modules (rnrs bytevectors) (rnrs io ports))
(let ((port (open-bytevector-input-port
	     (string->utf8 "Blablabla\nBlablabla\n"))))
  (seek port 13 SEEK_SET)
  (format #t "~c ~d\n" (peek-char port)
	  (ftell port)))
;; Outputs b 3 but should output b 13
[Message part 3 (text/plain, inline)]
This is using
guile (GNU Guile) 2.0.11
Packaged by Debian (2.0.11-deb+1-1)

-- 
David Kastrup

This bug report was last modified 9 years and 261 days ago.

Previous Next


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