# Difference between File and FileTest?

**URL:** <https://www.ruby-forum.com/t/difference-between-file-and-filetest/119869>\
**Category:** Ruby\
**Created:** [November 11, 2007, 5:43pm UTC](https://www.ruby-forum.com/t/difference-between-file-and-filetest/119869 "2007-11-11T17:43:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [November 11, 2007, 5:43pm UTC](https://www.ruby-forum.com/t/difference-between-file-and-filetest/119869/1 "2007-11-11T17:43:55Z")

</div>

I’m new to Ruby. I started writing some code that uses  
“FileTest.directory?” and found this method also available as  
“File.directory?”. So, why the two methods for doing the same thing  
and which should I be using? Thank you.

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [November 12, 2007, 12:27am UTC](https://www.ruby-forum.com/t/difference-between-file-and-filetest/119869/2 "2007-11-12T00:27:57Z")

</div>

Quoth Steve:

> I’m new to Ruby. I started writing some code that uses  
> “FileTest.directory?” and found this method also available as  
> “File.directory?”. So, why the two methods for doing the same thing  
> and which should I be using? Thank you.

Most people just use File.directory? now.
