Opened 4 years ago

#1342 new defect

Forcing output doesn't update the length

Reported by: mullen Owned by:
Priority: normal Milestone:
Component: other Version: 1.11
Keywords: Cc:

Description

This returns zero:

(defun wrong-file-length (pathname)
  (with-open-file (stream pathname :direction :output)
    (write-string "hello" stream)
    (finish-output stream)
    (file-position stream :start)
    (file-length stream)))

Seeking backward causes the length to be misreported, because flushing the buffer doesn't move the high-water mark (the "fileeof" slot).

Change History (0)

Note: See TracTickets for help on using tickets.