From: Glenn Parker Date: 2005-04-12T22:48:20+09:00 Subject: Re: Force newline only on Windows Steve V wrote: > How can I force \n in my strings to be *only* a newline character and not a > carriage return/newline combination on Windows? Use "binary" mode when opening your file, or invoke the "binmode" method on your IO object. File.open("x.txt", "wb") do |file| file.print "\n" end On Windows, x.txt will contain only "\n". If you leave out the "b", you will get "\r\n" instead. STDOUT.binmode print "\n" This will make the same change to stdout. -- Glenn Parker | glenn.parker-AT-comcast.net |