Index: /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyToHostLocation.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyToHostLocation.c	(revision 33360)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyToHostLocation.c	(revision 33361)
@@ -95,4 +95,5 @@
 	
       // need to re-open and re-read tgtname to check md5sum
+      // XXX this would be safer and faster if we used the remote shell to perform the md5sum locally.  
       if (!get_md5_with_copy (tgtname, NULL, tgtDigest)) {
 	fprintf (stderr, "error reading %s or getting md5\n", tgtname);
@@ -134,4 +135,9 @@
 	sprintf (tgtname, "%s/%s.%s", host->pathname, skylist->regions[i]->name, extname[j]);
 	sprintf (srcname, "%s/%s.%s", catdir, skylist->regions[i]->name, extname[j]);
+
+	// do not rename or unlink original if it does not exist..
+	status = stat (srcname, &filestat);
+	if (status && (errno == ENOENT)) continue;  
+	
 	if (!DEBUG && DELETE_ORIGINAL) {
 	  unlink (srcname);
