From: Xavier Noria Date: 2007-07-11T23:13:43+09:00 Subject: Re: How to get a newline when writing file from PC to Linux using Samba El Jul 11, 2007, a las 3:18 PM, billbell52 escribi�: > I am trying to write a text file on Unix (via Samba) from a Ruby > program running on the PC. I am trying to get the end of line > correct. I cannot get the Unix newline character (0x0a) in the file. > I am getting the same results when writing to either the PC or Linux > so Samba is not the issue. How do you do this? "\n" to native newline I/O conversion depends on the runtime platform, which in your case is Unix. In Unix no conversion is needed, so if you print a "\n" in Unix that's what you get (a single character with octal code 012). To output CRLF, the convention in your _target_ platform, output "\015 \012" by hand. The whole story is explained here http://www.onlamp.com/pub/a/onlamp/2006/08/17/understanding- newlines.html it is Perl-based but what explains applies to Ruby as well (expect perhaps for the corner case of Macs before OSX). -- fxn