From: nlper@... (Tyler) Date: 2001-11-17T04:48:58+09:00 Subject: [ruby-talk:25632] Re: Funky file.each_byte "GSP" wrote in message news:... > What you're running into, I think, is the fact that newlines in ms-dos are > actually two characters (ascii 10 and 13, I think). When you're reading > your file, the file system read's 10 and 13 and gives you one byte "\n". You're both exactly right. It's been years since I've messed with low-level DOS files and I'm out of practice. As a practical matter, an explicit file.binmode isn't necessary if you're more careful than I was. You can just append a 'b' to the access mode when you open the file for reading or writing. I.e., f = File.new(ARGV[0], "rb") Thanks, Tyler