I've just tested with SBCL-1.0.29 and the problem is still there. But CMUCL 19d gives the right result : 4

And Duane Rettig told me that it also works with Allegro CL :
http://groups.google.be/group/comp.lang.lisp/browse_thread/thread/d9c38e8fb0000a17?hl=fr#

Ben

2009/8/19 bb 4spam <bb4spam@gmail.com>
Hi,

With SBCL-1.0.18, the file position is 5 after a call of the function read-vector with a simple array of one '(signed-byte 32).
I would expect 4.

Here is how to reproduce :

;;(asdf:operate 'asdf:load-op :sb-simple-streams)

(defpackage streams-test
  (:use #:common-lisp #:sb-simple-streams))

(in-package #:streams-test)

(defun read-big-int (stream)
  (let ((b (make-array 1 :element-type '(signed-byte 32) :initial-element 0)))
    (declare (dynamic-extent b))
    (sb-simple-streams::read-vector b stream :endian-swap :network-order)
    (aref b 0)))

(with-open-file (stream "anyfile.txt"
            :class 'file-simple-stream)
  (print (file-position stream))
  (print (read-big-int stream))
  (print (file-position stream)))


Thx

Ben