Kent Johnson wrote: > Tony Cappellini wrote: >> I'm using shutils for the first time, and I've un into a problem. >> The docs for copytree are pretty sparse and don't mention any problem >> situations >> >> Under WinXP, I'm trying to copy a directory tree to a USB device using >> copytree, but copytree doesn't like a drive letter as a destination. >> >> copytree('C:\\testdir', 'g:\\') > > The source for copytree says, "The destination directory must not > already exist." I suppose that is why you have a problem but I don't > know the specific cause. Did you get a traceback? > > The source also says, "Consider this example code rather than the > ultimate tool" so maybe you should just copy it and make a version that > does what you want. See shutil.py in your Python lib directory.
Also -- vaguely -- have a look at my notes on file copying under windows to consider alternatives: http://timgolden.me.uk/python/win32_how_do_i/copy-a-file.html TJG _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor