shutil.copyfile problem for GIS data

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jul 16 14:20:09 EDT 2007


En Mon, 16 Jul 2007 14:47:30 -0300, Ahmed, Shakir <shahmed at sfwmd.gov>  
escribió:

> 2.	But problem is that  I can't copy over if the same updated
> personal geodatabase to the working location,  if users uses that same
> geodatabase through CITRIX - ArcGIS ( user does not have  permission to
> edit the data)

If you get an "Access denied" (or "File is in use by another process")  
error, I'm afraid there is nothing you can do from Python. Tell the users  
to close the application that holds the file open and try again.

> import shutil
> import os
>
> src = "c:\mydata\test\mygeo.mdb"
> dst = "v:\updated\data\mygeo.mdb"

Here you have another problem: \t inside a string means the TAB character.  
You have to escape all backslashes or use a raw string:
that is, either use "c:\\mydata\\test\\mygeo.mdb" or  
r"c:\mydata\test\mygeo.mdb"


-- 
Gabriel Genellina




More information about the Python-list mailing list