2d6c8b5aa593976bc312cb3111d9d4cd7b46938a
jcasper
  Wed Oct 2 09:29:18 2024 -0700
Position liftovers need to clean up temp files when they're done, refs #28023

diff --git src/hg/lib/liftOver.c src/hg/lib/liftOver.c
index 11e1626..b901c5b 100644
--- src/hg/lib/liftOver.c
+++ src/hg/lib/liftOver.c
@@ -1446,30 +1446,35 @@
 while (lineFileNext(lf, &line, NULL))
     {
     if (line[0] == '#')
         fprintf(unmapped, "%s\n", line);
     else
         {
         wordCount = chopLine(line, words);
         chrom = words[0];
         start = lineFileNeedNum(lf, words, 1);
         end = lineFileNeedNum(lf, words, 2);
         fprintf(unmapped, "%s:%d-%d\n", chrom, 
                         BEDSTART_TO_POSITION(start), end);
         }
     }
 lineFileClose(&lf);
+
+// Now to clean up the temp files: bedTn, mappedBedTn, and unmappedBedTn
+unlink(bedTn.forCgi);
+unlink(mappedBedTn.forCgi);
+unlink(unmappedBedTn.forCgi);
 return ct;
 }
 
 enum liftOverFileType liftOverSniff(char *fileName)
 /* the file-sniffing bit used to distinguish bed from positions files */
 /* returns enum concerning the file type */
 {
 struct lineFile *lf = lineFileOpen(fileName, TRUE);
 char *line = NULL;
 char *chrom = NULL, *start = NULL, *end = NULL;
 boolean isPosition = FALSE;
 lineFileNextReal(lf, &line);
 if (!line)
     return 0;
 chrom = cloneString(line);