Copy directory tree without copying files

Jeremy Conlin jlconlin at gmail.com
Wed Sep 23 18:03:15 CEST 2009


On Sep 23, 9:44 am, Grant Edwards <inva... at invalid.invalid> wrote:
> On 2009-09-23, Jeremy Conlin <jlcon... at gmail.com> wrote:
>
> > I am trying to copy a folder hierarchy from one location to another.
> > I can use the shutil.copytree function to copy the folder tree, but I
> > don't want the files copied, just the folders.  What is a good way to
> > approach this?
>
> Just in case there's no real requirement to use Python...
>
> $ (cd srcdir; find . -type d) | (cd dstdir; xargs mkdir)

Thanks, but this has to be platform independent so Python seemed like
a good choice.

Jeremy



More information about the Python-list mailing list