Make directory path: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "{{draft task}} Given a path to a directory (for example <code>./path/to/dir</code>) create the directory and any missing parents. If the directory already exists, return succ...")
 
No edit summary
Line 4: Line 4:


This task is named after the posix <code>[http://www.unix.com/man-page/POSIX/0/mkdir/ mkdir -p]</code> command, and several libraries which implement the same behavior.
This task is named after the posix <code>[http://www.unix.com/man-page/POSIX/0/mkdir/ mkdir -p]</code> command, and several libraries which implement the same behavior.
Ideally implementations will work equally well cross-platform (on windows, linux, and OS X).



=={header|Python}==
<lang Python>
def mkdirp(path):
</lang>

Revision as of 04:22, 9 August 2014

Make directory path is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Given a path to a directory (for example ./path/to/dir) create the directory and any missing parents. If the directory already exists, return successfully.

This task is named after the posix mkdir -p command, and several libraries which implement the same behavior. Ideally implementations will work equally well cross-platform (on windows, linux, and OS X).


{header|Python}

<lang Python> def mkdirp(path):

</lang>