From: Robert Klemme Date: 2009-05-17T06:00:04+09:00 Subject: Re: File.write a long line On 16.05.2009 21:36, Mk 27 wrote: > I notice you can do this with print: > > print "blah blah", > "and so on" > > but not with File.write, except > > file.write "blah blah / > and so on" > > which is no good cause it includes all the whitespace. I guess I can > live with > > file.write "blah blah" > file.write "and so on" > but I thot I'd check and see if there is not some wierd combination of + > , / etc that would allow me to break the line, as I imagine the same > logic will apply in other ruby methods. You can do file.write "blah blah " + "and so on" file.write "blah blah " \ "and so on" I myself use these rules of thumb to decide which method to use: 1. printing of text: puts, print, printf 2. output of binary or chunked data: write E.g. for copying data from one file to another, I'd do buffer = "" while io1.read(1024, buffer) io2.write buffer end > Thanks in advance! Ruby seems very nice, I am happy. Good! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/