Skip to content
Snippets Groups Projects
Commit b10e98ff authored by gerd's avatar gerd
Browse files

(with-open-file (stream "test.123" :direction :output

	                        :if-exists :supersede)
	  (format stream "~S ~S ~S~%" 'these 'are 'symbols))

	(with-open-file (stream "test.123" :direction :io
	                        :if-exists :overwrite)
	  (read stream) (prin1 'insert stream))

	(with-open-file (stream "test.123")
	  (loop for line = (read-line stream nil)
	        until (null line) do (write-line line)))

	Output should be "these insertmbols"
	Output is "these are symbols\ninsert"

	* src/code/fd-stream.lisp (def-output-routines): If there is any
	input read from UNIX but not supplied to the user of the stream,
	reposition to the real file position as seen from Lisp.
	Reported by Adam Warner.
parent e3d1deb1
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.72 2003/08/19 09:26:57 gerd Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.73 2003/11/03 16:50:28 gerd Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -254,6 +254,14 @@
(+ (fd-stream-obuf-tail stream)
,size))
(flush-output-buffer stream)))
;;
;; If there is any input read from UNIX but not
;; supplied to the user of the stream, reposition
;; to the real file position as seen from Lisp.
,(unless (eq (car buffering) :none)
`(when (> (fd-stream-ibuf-tail stream)
(fd-stream-ibuf-head stream))
(file-position stream (file-position stream))))
,@body
(incf (fd-stream-obuf-tail stream) ,size)
,(ecase (car buffering)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment