# \[ruby-trunk - Feature #10381\] Pathname#mkdir\_p, Pathname#makedirs が欲しい

**URL:** <https://www.ruby-forum.com/t/ruby-trunk-feature-10381-pathname-mkdir-p-pathname-makedirs/232532>\
**Category:** Development\
**Created:** [October 15, 2014, 6:28am UTC](https://www.ruby-forum.com/t/ruby-trunk-feature-10381-pathname-mkdir-p-pathname-makedirs/232532 "2014-10-15T06:28:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 15, 2014, 6:28am UTC](https://www.ruby-forum.com/t/ruby-trunk-feature-10381-pathname-mkdir-p-pathname-makedirs/232532/1 "2014-10-15T06:28:37Z")

</div>

Issue #10381 has been updated by 三村 益隆.

> mkdir\_p はコマンド名っぽくておすすめしたくないな、と思っています。  
> FIleUtils では mkdir\_p のほうがコマンドの挙動がすぐ連想できるの使っています。  
> FileUtils からの連想で Pathname に無いというのを気づいたため、Pathname#mkdir\_p  
> があると嬉しいと感じています。

FileUtils#mkpath と FileUtils#mkdir\_p どちらがよく使われているか気になって、GitHub  
でコードの検索をしたところ FileUtils#mkdir\_p のほうがよく使われているようです。

FileUtils#mkdir\_p 369,095  
[https://github.com/search?l=ruby&q=FileUtils.mkdir\_p&ref=searchresults&type=Code&utf8=✓](https://github.com/search?l=ruby&q=FileUtils.mkdir_p&ref=searchresults&type=Code&utf8=%E2%9C%93)  
FileUtils#mkpath 17,014  
[https://github.com/search?utf8=✓&q=FileUtils.mkpath&type=Code&ref=searchresults](https://github.com/search?utf8=%E2%9C%93&q=FileUtils.mkpath&type=Code&ref=searchresults)

* * *

Feature #10381: Pathname#mkdir\_p, Pathname#makedirs が欲しい

> **[Feature #10381: Pathname#mkdir\_p, Pathname#makedirs が欲しい - Ruby master - Ruby...](https://bugs.ruby-lang.org/issues/10381#change-49443)**
>
> Redmine

- Author: 三村 益隆
- Status: Feedback
- Priority: Normal
- Assignee: Akira T.
- Category:
- Target version:

* * *

Pathname#mkpath にも FileUtils#mkpath と他の同じ挙動をするメソッド名が欲しいです。

```auto
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 82541e9..40c3ae1 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -564,6 +564,8 @@ class Pathname # * FileUtils *
     FileUtils.mkpath(@path)
     nil
   end
+ alias :mkdir_p :mkpath
+ alias :makedirs :mkpath

   # Recursively deletes a directory, including all directories beneath 
it.
   #

```
