Re: Copy directory tree without copying files

2009-09-23 Thread Jeremy Conlin
On Sep 23, 9:44 am, Grant Edwards wrote: > On 2009-09-23, Jeremy Conlin 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 wa

Re: Copy directory tree without copying files

2009-09-23 Thread Grant Edwards
On 2009-09-23, Jeremy Conlin 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

Re: Copy directory tree without copying files

2009-09-23 Thread Jeremy Conlin
On Sep 23, 9:31 am, Tim Golden wrote: > Jeremy Conlin wrote: > > On Sep 23, 9:15 am, Tim Golden wrote: > >> Jeremy Conlin 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

Re: Copy directory tree without copying files

2009-09-23 Thread Jeremy Conlin
On Sep 23, 9:15 am, dwatrous wrote: > Have you considered using > os.walk?http://docs.python.org/library/os.html#os.walk > > It won't be completely automated, but I think it should allow you to > easily walk the directory structure to reproduce it in another > location. > > If the file names/exte

Re: Copy directory tree without copying files

2009-09-23 Thread Peter Otten
Jeremy Conlin 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? The easiest is def ignore(folder, names):

Re: Copy directory tree without copying files

2009-09-23 Thread Tim Golden
Jeremy Conlin wrote: On Sep 23, 9:15 am, Tim Golden wrote: Jeremy Conlin 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 appro

Re: Copy directory tree without copying files

2009-09-23 Thread Jeremy Conlin
On Sep 23, 9:15 am, Tim Golden wrote: > Jeremy Conlin 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 thi

Re: Copy directory tree without copying files

2009-09-23 Thread dwatrous
Have you considered using os.walk? http://docs.python.org/library/os.html#os.walk It won't be completely automated, but I think it should allow you to easily walk the directory structure to reproduce it in another location. If the file names/extensions are predictable you might also be able to us

Re: Copy directory tree without copying files

2009-09-23 Thread Tim Golden
Jeremy Conlin 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? Thanks, Jeremy Use os.walk and create the directo

Copy directory tree without copying files

2009-09-23 Thread Jeremy Conlin
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? Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list