AnsweredAssumed Answered

Timestamp File in File Geodatabase (directory)

Question asked by jborgion Champion on Oct 13, 2017
Latest reply on Oct 27, 2017 by jborgion

As I work through a python project, I'd like to delete a directory that contains a file geodatabase. Using shutil.rmtree(directory_containing_Filegdb) with the mxd still open, I get an Windows error about a file called timestamp in MyFileGeodatabse.gdb that is being used by another process.


A google search of  "file geodatabase timestamp" turns up an article from ESRI Tech Support saying it's okay to remove the lock file but warns not to remove the timestamp file as it will corrupt the file geodatabse.


Warnings?  I don't need no stinkin' warnings....


I can run arcpy.Delete_management(the_file_fgd_workspace) in the python window and it runs without an error. But....  It leaves behind the the"directory" MyFileGeodatabse, along with the timestamp file within it: all the other files associated with what we know as a file geodatabase are gone.


The original premise of this application is to create a directory as well as a file gdb, as a target gdb for a replica.  Once the replica is synced back to the parent, the idea is to delete to whole mess, so the user can move on to another area of interest, re-create the directory and the file geodatabase, create a replica etc, etc.


Surely, I can set the directory and file gdb up a priori, and simply empty the feature classes out of that file geodatabase when the edits are done, but I'd like not to leave anything behind at the end of the day if possible.