From: Phillip Gawlowski Date: 2007-04-19T19:49:50+09:00 Subject: Re: Non exclusive file access bino_oetomo wrote: > > ---Start---- > irb > irb(main):001:0> my_file = File.new("/mnt/ramdisk0/line3", modestring="a+") my_file = File.open("/mnt/ramdisk0/line3", "w") > 2. the file.puts command always write to the end of the file, How to make > ruby just overide the content of the file with it's output ? > (just like bash ==> echo "something" >./thisfile ) The mode "a+" appends to a file, "w" overwrites an existing file, or creates a new file. See here: http://www.zenspider.com/Languages/Ruby/QuickRef.html#14 -- Phillip "CynicalRyan" Gawlowski http://cynicalryan.110mb.com/ http://clothred.rubyforge.org Rule of Open-Source Programming #13: Your first release can always be improved upon.