Where does Ruby keep track of its open file descriptors?
What This Question Is Not About This question is not about how to auto-close a file with File#close or the File#open block syntax. It's a question about where Ruby stores its list of open file descriptors at runtime. The Actual Question If you have a program with open descriptors, but you don't have access to the related File or IO object, how can you find a reference to the currently-open file descriptors? Take this example: filename='/tmp/foo' %x( touch "#{filename}" ) File.open(filename) filehandle = File.open(filename) The first File instance is opened, but the reference to the object is