# Difference between File and FileTest?

**URL:** <https://rubytalk.org/t/difference-between-file-and-filetest/42096>\
**Category:** ruby-talk\
**Created:** [11 November 2007 16:43 UTC](https://rubytalk.org/t/difference-between-file-and-filetest/42096 "2007-11-11T16:43:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve8](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Steve8](https://rubytalk.org/u/Steve8)\
**Post date:** [11 November 2007 16:43 UTC](https://rubytalk.org/t/difference-between-file-and-filetest/42096/1 "2007-11-11T16:43:11Z")

</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:** ![Konrad\_Meyer](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@Konrad\_Meyer](https://rubytalk.org/u/Konrad_Meyer)\
**Post date:** [11 November 2007 23:27 UTC](https://rubytalk.org/t/difference-between-file-and-filetest/42096/2 "2007-11-11T23:27:30Z")

</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.

> **···**
>
> --  
> Konrad Meyer \<konrad@tylerc.org\> [http://konrad.sobertillnoon.com/](http://konrad.sobertillnoon.com/)
