Mathieu Bouchard wrote:
> On Thu, 12 Jan 2006, Bertram Scharpf wrote:
> 
>>  File.open "somefile", "a" do |f|
>>    f.flock File::LOCK_EX do
>>      f.print ...
>>    end
>>  end
> 
> 
> class File
>   def blocklock(x)
>     flock x
>     yield
>   ensure
>     flock LOCK_UN
>   end
> end

It seems likely to me that a lot of people have implemented exactly that
same piece of code, probably more than once. The #flock method doesn't
have a block_given case already, and it's pretty unambiguous how it
should handle that case...

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407