56838d1c8e906cfa57b57f209ff9dd718e53efe7
kent
  Thu Sep 12 14:37:40 2013 -0700
Adding parallelFetchRemovePartial clean up function.
diff --git src/lib/paraFetch.c src/lib/paraFetch.c
index e6e0189..0ea1f6b 100644
--- src/lib/paraFetch.c
+++ src/lib/paraFetch.c
@@ -55,30 +55,39 @@
 /* Return last mod date of temp file - which is useful to see if process has stalled. */
 {
 char outTemp[1024];
 safef(outTemp, sizeof(outTemp), "%s.paraFetch", origPath);
 if (fileExists(outTemp))
     return fileModTime(outTemp);
 else if (fileExists(origPath))
     return fileModTime(origPath);
 else
     {
     errAbort("%s doesn't exist", origPath);
     return 0;
     }
 }
 
+void parallelFetchRemovePartial(char *destName)
+/* Remove any files associated with partial downloads of file of given name. */
+{
+char paraTmpFile[PATH_LEN];
+safef(paraTmpFile, PATH_LEN, "%s.paraFetch", destName);
+remove(paraTmpFile);
+safef(paraTmpFile, PATH_LEN, "%s.paraFetchStatus", destName);
+remove(paraTmpFile);
+}
 
 boolean paraFetchReadStatus(char *origPath, 
     struct parallelConn **pPcList, char **pUrl, off_t *pFileSize, 
     char **pDateString, off_t *pTotalDownloaded)
 /* Read a status file - which is just origPath plus .paraFetchStatus.  This is updated during 
  * transit by parallelFetch. Returns FALSE if status file not there - possibly because
  * transfer is finished.  Any of the return parameters (pThis and pThat) may be NULL */
 {
 char outTemp[1024];
 char outStat[1024];
 safef(outStat, sizeof(outStat), "%s.paraFetchStatus", origPath);
 safef(outTemp, sizeof(outTemp), "%s.paraFetch", origPath);
 struct parallelConn *pcList = NULL, *pc = NULL;
 off_t totalDownloaded = 0;