# Checking to see if a file is open (newbie)?

**URL:** <https://www.ruby-forum.com/t/checking-to-see-if-a-file-is-open-newbie/144566>\
**Category:** Ruby\
**Created:** [July 31, 2008, 12:22am UTC](https://www.ruby-forum.com/t/checking-to-see-if-a-file-is-open-newbie/144566 "2008-07-31T00:22:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlockney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tlockney](https://www.ruby-forum.com/u/tlockney)\
**Post date:** [July 31, 2008, 12:22am UTC](https://www.ruby-forum.com/t/checking-to-see-if-a-file-is-open-newbie/144566/1 "2008-07-31T00:22:11Z")

</div>

I’m almost embarassed to ask this, but does Ruby have any method (e.g.  
File.open?) to check to see if a file is open? I see many methods in  
File class, but nothing that addresses this directly. I googled it a  
number of times and could not find a answer to this (dumb) question…

---

<div class="post-metadata">

**Author:** ![tlockney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tlockney](https://www.ruby-forum.com/u/tlockney)\
**Post date:** [July 31, 2008, 12:26am UTC](https://www.ruby-forum.com/t/checking-to-see-if-a-file-is-open-newbie/144566/2 "2008-07-31T00:26:25Z")

</div>

On Wed, Jul 30, 2008 at 6:21 PM, Thomas L.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m almost embarassed to ask this, but does Ruby have any method (e.g.  
> File.open?) to check to see if a file is open? I see many methods in  
> File class, but nothing that addresses this directly. I googled it a  
> number of times and could not find a answer to this (dumb) question…

File#closed?
