From: Simon Cozens Date: 2002-10-22T18:36:27+09:00 Subject: Re: What I did (was Re: functional Ruby equiv to this perl snippet) dblack@candle.superlink.net writes: > > if FileTest.exist?(filename) > > File.open(filename).each do |line| > > Just to point out that you're introducing a wee race condition, > because it's possible for the file to be deleted (by another process) > between the exist? test and the open. Also, don't forget that there are more ways an open can fail than just ENOENT; but maybe in those conditions you'd prefer to throw an exception anyway. -- Old Japanese proverb: There are two kinds of fools -- those who never climb Mt. Fuji, and those who climb it twice.