[cmucl-ticket] [cmucl] #79: File-position at start of file is wrong

cmucl cmucl-devel at common-lisp.net
Sat Mar 23 06:04:24 UTC 2013


#79: File-position at start of file is wrong
--------------------+-------------------------------------------------------
 Reporter:  rtoy    |       Owner:  somebody 
     Type:  defect  |      Status:  new      
 Priority:  major   |   Milestone:           
Component:  Core    |     Version:  2013-03-a
 Keywords:          |  
--------------------+-------------------------------------------------------
 Let {{{foo}}} be an file of latin1 characters.  Then

 {{{
 (with-open-file (s "foo" :external-format :latin1)
   (print (file-position s))
   (read-char s)
   (print (file-position s)))
 }}}

 prints

 {{{
 512
 513
 }}}

 This is totally unexpected.  I would expect 0 and 1 to be printed.

 If {{{foo}}} has utf8 encoding then

 {{{
 (with-open-file (s "foo" :external-format :utf8)
   (print (file-position s))
   (read-char s)
   (print (file-position s)))
 }}}

 prints something like

 {{{
 512
 1
 }}}

 I would expect 0 to be printed instead of 512.

-- 
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/79>
cmucl <http://common-lisp.net/project/cmucl>
Cmucl is a high-performance, free Common Lisp implementation.


More information about the cmucl-ticket mailing list