[Python-Dev] mkdir -p in python (original) (raw)

Ray Allen ysj.ray at gmail.com
Wed Jul 28 10:42:49 CEST 2010


I believe, in design purpose, the os.mkdir() is to match the system call "mkdir()" exactly, the os.makedirs() is a "Super-mkdir", it provides extra convenience for using when we want to create directories. This is the case makedirs() should deal with. A new function maybe confused with makedirs().

I think os.makedirs() should go to shutil, but we have missed the right time.

On Wed, Jul 28, 2010 at 3:29 PM, Hrvoje Niksic <hrvoje.niksic at avl.com>wrote:

On 07/27/2010 06:18 PM, Alexander Belopolsky wrote:

On Tue, Jul 20, 2010 at 10:20 AM, R. David Murray<rdmurray at bitdance.com> wrote:

I'd go with putting it in shutil.

+1 I would also call it shutil.mktree which will go well with shutil.rmtree next to it. Note that mktree is not analogous to rmtree - while rmtree removes a directory tree beneath a specified directory, mktree would only create a single "branch", not an entire tree. I'd imagine a mktree function to accept a data structure describing the tree to be created. If you're going for a short name distinctive from mkdir, I propose mksubdirs.


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ysj.ray%2Bpython-dev%40gmail.com

-- Ray Allen Best wishes! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20100728/2d3d5ced/attachment.html>



More information about the Python-Dev mailing list