Comment 1 for bug 1600610

Revision history for this message
Guillaume LE VAILLANT (guillaume-le-vaillant) wrote :

Flushing the output buffer by hand before reading seems to work.

(with-open-file (stream "string.txt"
                        :direction :io
                        :if-exists :overwrite
                        :if-does-not-exist :create)
  (write-string "abc" stream)
  (file-position stream 0)
  (write-char #\d stream)
  (finish-output stream)
  (read-char stream))
=> #\b

Maybe the code for flushing the output buffer before reading in the case of a file stream opened in io mode is missing...