This isn't a file copy.  I'm just writing data to a file.

This is equivalent :

File.open("/file/location/new.txt","w") {|file| file << "data to write"}

> Hello --
> 
> On 30/10/2007, Chris Richards <evilgeenius / gmail.com> wrote:
>> Is there a better way to write text to a file?
>>
>> File.open("/file/location/new.txt","w") {|file| file.write "data to
>> write"}
>>
>> It just seems a bit long winded and unmessy
> 
> File.copy in this instance, surely?
> 
> -- Thomas Adam

-- 
Posted via http://www.ruby-forum.com/.