Mkdir -p

>> Dir methods are one to one relationship to the system calls.
>> FileUtils are more abstract/higher level/uniformed way to
operate on
>> files/directories.
>
>This is a technical explanation, but not a reason...

It's a technical explanation and a design policy.

sir Matz,

I see that FileUtils already has mkdir. Is it possible to include an option
like -p for FileUtils.mkdir, like :recurse => true or :parents => true
perhaps?

              matz.

kind regards -botp

···

matz@ruby-lang.org [mailto:matz@ruby-lang.org] wrote:

Hi,

···

In message "Re: mkdir -p" on 04/06/15, "Peña, Botp" <botp@delmonte-phil.com> writes:

I see that FileUtils already has mkdir. Is it possible to include an option
like -p for FileUtils.mkdir, like :recurse => true or :parents => true
perhaps?

Hmm, do you want to have

  FileUtils.mkdir path, :recurse => true

in addition to independent mkdir_p method? How come?

              matz.

Hi,

  In mail "Re: mkdir -p"

I see that FileUtils already has mkdir. Is it possible to include an option
like -p for FileUtils.mkdir, like :recurse => true or :parents => true
perhaps?

I think different operations should be mapped on different methods.
That is the reason why both of #mkdir and #mkdir_p exist. I used
UNIX command name analogy, but FileUtils is not a UNIX command
(mkdir(1) does not have --noop option).

In addition, Perl has two separate functions, mkdir and mkpath.

Regards,
Minero Aoki

···

"Peña, Botp" <botp@delmonte-phil.com> wrote: