From: Roger Pack Date: 2009-05-08T21:50:50+09:00 Subject: Re: how to find and close opened file descriptor > And now I am assuming the maximum file no is 1023. Is there any way that > I can get the maximum file no? You could run a loop at the beginning of your script which detects it :) count = 0 all = [] begin loop { all << File.open('test','w') } rescue Exception count = all.length for file in all do; file.close; end end count But getting back to your original question, another way to close descriptors is GC.each_object(IO) do |io| io.close; end I guess. Not totally sure what you mean by "doesnt create file descriptors for each inherited object" ? Thanks. -=r -- Posted via http://www.ruby-forum.com/.