jgcox

arcpy tools sometimes annihilating file pointers, causing data loss

Discussion created by jgcox on May 21, 2011
Latest reply on Jun 1, 2011 by jgcox
Howdy all,
  I've written a set of tools using arcpy to do tile cache updates, principally relying on functions like ManageMapServerCacheTiles_server, SelectLayerByAttribute_management, and CopyFeatures_management.
  Recently, I lost a bunch of data from my hard drive. It turns out that the pointers to the files and directories simply vanished, and my OS happily wrote over those sectors with new data. Fearing hard drive failure or malware, I purchased completely new hard drives and installed Windows 7 anew. However, this happened almost immediately again, although the only directory affected was Python26/ArcGIS10.0, from which about half the contents just vanished. Again, the files were there, they just had their pointers disappear.
  I remained confused by all this until I passed along my python scripts to a colleague for testing. He ran the scripts while having ArcInfo running, got an error, and then had the same thing happen to him. A bunch of his data vanished when the pointers were annihilated.
  My colleague thinks it has something to do with our setting arcpy.env.overwriteOutput="True" because it was the contents of his arcpy.env object that were affect. However, in my original data loss, many directories that had nothing to do with ArcGIS anything were affected. I have also searched and found nothing indicating that setting arcpy.env.overwriteOutput="True" is dangerous. That said, the only file manipulation that my script does outside of the arcpy tools is to create a text file and append some strings to it as a log, so I don't see any other suspects besides the arcpy tools.
  Has anyone else encountered such a phenomenon? Have I accidentally written a trojan horse?

cheers,
jonathan cox

Outcomes