From: Brian Candler Date: 2010-03-10T21:12:11+09:00 Subject: Re: how to test if a file is open ? Giampiero Zanchi wrote: > You could use exceptions I thought the OP was interested in whether *another* process had the same file open. If you just want to test whether a Ruby File object is closed, there is a 'closed?' method. irb(main):002:0> f = File.open("/etc/passwd") => # irb(main):003:0> f.closed? => false irb(main):004:0> f.close => nil irb(main):005:0> f.closed? => true -- Posted via http://www.ruby-forum.com/.