3 ms·
File.open('path', 'w') do |f| f << something end will do what you want
by aaronblohowiak 17y ago
File.open('path', 'w') do |f|
f << something
end
will do what you want
- kscaldef 17y agoIt might be good to read the whole discussion, particularly noting what I personally have said, before making conclusions about what I want.
- aaronblohowiak 17y agoI should have simply explained that my example will close the file handle and flush the changes out at the end of the block passed to the anonymous file handle, instead of making a statement about your wants.