>>>>> "B" == Bill Kelly <billk / cts.com> writes: B> for instance, if the above were in a loop. Would it be possible to B> run out of file handles before GC was called? no, B> If so, I would personally find myself resistant to adopting the B> idiom of letting GC close file handles, as I would view the B> relationship between the opener of the handles, and GC, as a B> potential race condition lurking in my code. . . . But it could be B> I worry too much. :) Well, you must know that some persons like me are stupid and forget to close the files and I frequently write pigeon% cat b.rb #!/usr/bin/ruby require 'bz2' a = File.new("aa", "w") bz2 = BZ2::Writer.new(a) 12.times {|i| bz2.puts i } pigeon% pigeon% b.rb pigeon% pigeon% bunzip2 < aa 0 1 2 3 4 5 6 7 8 9 10 11 pigeon% If the file is not automatically closed, I will lost many data :-))) Guy Decoux