Re: Merge two directories together

2010-04-16 Thread Dave W.
> While Python provides some helpful methods for moving files and > directories around (shutil.move, shutil.copytree, etc), none of > them seem to be able to merge two directories. -snip- > Any ideas? It's not pretty, but you could hack up the original copytree() source so it ignores errors from t

Re: Merge two directories together

2010-04-16 Thread Steven Howe
Think about using the subprocess module. There are calls made just for your. Notably (using command pydoc subprrocess.call) : - subprocess.call = call(*popenargs, **kwargs) Run command with arguments. Wait for command to complete, then return the returncode attribute.

Merge two directories together

2010-04-16 Thread Keith Hughitt
Suppose you have two file-trees with common sub-directories but different files that you want to merge together, e.g. /test/ /test/a/ /test/a/file1 /test2/ /test2/a/ /test2/a/file2 You can easily merge the directories in Linux using the "cp" command: cp -r test/* test2/ While Python provides s