# How to create directory in file system

**URL:** <https://www.ruby-forum.com/t/how-to-create-directory-in-file-system/97445>\
**Category:** Ruby\
**Created:** [July 7, 2006, 3:03am UTC](https://www.ruby-forum.com/t/how-to-create-directory-in-file-system/97445 "2006-07-07T03:03:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [July 7, 2006, 3:03am UTC](https://www.ruby-forum.com/t/how-to-create-directory-in-file-system/97445/1 "2006-07-07T03:03:21Z")

</div>

This seems like it should be an easy thing to figure out, but I’ve been  
Googling for a half hour, plus looked in the Pickaxe book, but can’t  
seem to find an answer, so please forgive a really newbie-ish question,  
but…

How do you create a directory in Ruby? It appears to be via File.new,  
but I can’t figure out anything further than that.

Any help would be greatly appreciated.

TIA,  
Jeff

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [July 7, 2006, 3:08am UTC](https://www.ruby-forum.com/t/how-to-create-directory-in-file-system/97445/2 "2006-07-07T03:08:53Z")

</div>

On 7/7/06, Jeff LaMarche [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This seems like it should be an easy thing to figure out, but I’ve been  
> Googling for a half hour, plus looked in the Pickaxe book, but can’t  
> seem to find an answer, so please forgive a really newbie-ish question,  
> but…
> 
> How do you create a directory in Ruby? It appears to be via File.new,  
> but I can’t figure out anything further than that.

I’ve been using FileUtils.mkdir.

;Daniel

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [July 7, 2006, 3:42am UTC](https://www.ruby-forum.com/t/how-to-create-directory-in-file-system/97445/3 "2006-07-07T03:42:27Z")

</div>

Dir.mkdir(“c:/asdf”)
