From: Li Chen Date: 2006-11-04T02:24:16+09:00 Subject: Re: Unable to write to file... (example from "pickaxe book", Mike Fletcher wrote: > John Maclean wrote: >> Thanks! The light shines. So how can i -write- to a file using the code >> below as an example? > > Open a file for writing > > File.open( "infile", "r" ) | in | > File.open( "outfile", "w" ) | out | > while line = in.gets > out.print line > end > end > end > > See the docs for IO which explain all the mode flags ("r", "w", "a", > etc.). Do you think this script work? Li -- Posted via http://www.ruby-forum.com/.