Erik Veenstra wrote: > Consider... > > File.new("file.ext", "w").write data > ... > I know you can do... > > File.open("file.ext", "w"){|f| f.write data} > > ...., but the first one is shorter and better readable. > If being short and readable is your concern, you can always extend the class to do what you want. something like: class << File def write_at_once fn, data self.open(fn,'w'){|f|f.write(data)} end end File.write_at_once('file.ext', data)