[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: file_put_contents analog?

Gavin Kistner

10/13/2006 8:35:00 PM

From: Joe Ruby MUDCRAP-CE
> PHP has a function file_put_contents(file, stuff) -- is there any
> similar single command in Ruby?

def file_put_contents( name, *contents )
File.open( name, "w+" { |file|
contents.each{ |item|
file << item
}
}
end