I need to create an empty (or at least garbage) file of a certain size.
I'm doing it the way below, but it is rather slow -- any ideas on a
quicker way?
File.open("tmp.txt", 'w') { |f| 10.megabytes.times { f.write "a" } }
I need to create an empty (or at least garbage) file of a certain size.
I'm doing it the way below, but it is rather slow -- any ideas on a
quicker way?
File.open("tmp.txt", 'w') { |f| 10.megabytes.times { f.write "a" } }
Thanks!
~ Mark
--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama