From: Xavier Noria Date: 2007-09-02T09:52:30+09:00 Subject: Re: force file write in dos format On Sep 1, 2007, at 1:16 PM, Martin DeMello wrote: > Is there any built-in way to force File.puts to use dos line endings, > regardless of the platform under which the program is running? If I undertand correctly what you want your program is going to explicitly output pairs "\r\n". If that's the case, in addition to the recommendation about IO#print already given take into account that the io needs binmode. Otherwise, on CRLF platforms you'd end up with "\r\r\n" on disk, which would be wrong. That's because the single "\n" in "\r\n" gives itself a pair "\r\n" in text mode. So IO#print CRLF in binmode is the complete portable solution. -- fxn