From: 7stud -- Date: 2009-02-10T01:25:34+09:00 Subject: Re: file.puts define newline MrBanabas@googlemail.com wrote: > On 9 Feb., 14:50, badboy wrote: >> MrBana...@googlemail.com schrieb:> Hi, >> >> > just would like to know if I can somehow define the newline delimeter >> > when using file.puts ? >> > e.g. /n, /r/n >> >> > Thanks a lot in advance... >> >> hm...I don't think so. >> Can't you use file.print and append a "\r\n" or whatever you need? > > Sure I can do that, but I thought it would be "cleaner" if I could to > something like: > file = new File.... > file.newline_delimiter = '/r/n' > or > file.newline_delimiter = 'dos' You are supposed to be able to do this: $OUTPUT_RECORD_SEPARATOR = "apple" f = File.open("data.txt", "w") f.write "hello world" f.write "goodbye" f.close() but the output I get in data.txt is: hello worldgoodbye -- Posted via http://www.ruby-forum.com/.