Afficher un message
Vieux 11/05/2008, 10h42   #3
Minic Hoberoff
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: IO#putc writing 2 bytes?

Ah ha! Indeed I am on Windows. I knew about the LF to CRLF conversion,
but it never struck me.

To make a long story short, I tried to open the file with mode a+b which
was what I needed. Then @SaveFile.pos quit working on me even after
@SaveFile.rewind, it would write to the end of the file. So I
@SaveFile.binmode and BOOM, my first Ruby script is now working as
intended!

Thank you so very much. I never would of figured it would do the
conversion when not in binary mode.

So now the REAL question is, am I to blame or is Windows? :P (don't
answer that)

Thanks again, you truly made my night!
-Minic
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
 
Page generated in 0,04646 seconds with 9 queries