Select to view content in your preferred language

Shutil Folder Move in Python

2331
4
04-19-2011 09:46 AM
by Anonymous User
Not applicable
Original User: rdg129

http://docs.python.org/library/shutil.html

I have tried to use the Shutil module in Python and it never seems to work.

All I want is to move everything in one folder to another folder, can someone help with the syntax.
0 Kudos
4 Replies
ChrisSnyder
Honored Contributor
Are you using shutil.copytree()?

I've notice that quite often lock files persist in the FGDB folders (even after all the featurelayers, tableviews, cursor refs, etc are deleted). In that case, I have had to rely on the (frankly much slower) gp.Copy_management() tool.
0 Kudos
by Anonymous User
Not applicable
Original User: rdg129

Good to know, tell me about the copy management tool.  Works Better than the copytree?
0 Kudos
ChrisSnyder
Honored Contributor
Not much to tell, but it seems to work when shutil.copytree throw an error about some .lock file in a .fgdb folder having a file sharing issue. Try it and you may I say...
0 Kudos
by Anonymous User
Not applicable
Original User: rdg129

thanks - that worked.
0 Kudos