Robert Klemme
5/16/2008 7:22:00 AM
2008/5/16 Mark Dodwell <seo@mkdynamic.co.uk>:
>> fd.truncate( 2 ** 20 )
>
> Thanks that's great, didn't know about that method!
If it does not work on your platform, you can speed up your solution
by writing larger chunks:
BUFFER = ("a" * 1024).freeze
File.open("tmp.txt", 'wb') { |f| 10.kilobytes.times { f.write BUFFER } }
Kind regards
robert
--
use.inject do |as, often| as.you_can - without end