[Genabel-commits] r1640 - in pkg/DatABEL: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 15 01:03:30 CET 2014


Author: lckarssen
Date: 2014-03-15 01:03:29 +0100 (Sat, 15 Mar 2014)
New Revision: 1640

Modified:
   pkg/DatABEL/ChangeLog
   pkg/DatABEL/R/text2databel.R
Log:
Added the option "unlinkTmpTransposeFiles" to the text2databel() function in DatABEL. When set to TRUE this option deletes intermediate (temporary) files left behind by the call to the C function text2fvf_R in AbstractMatrix_R.cpp.
By default this option is set to TRUE, so this actually changes what happened before (the tmp files were left behind, eating disk space). On the other hand, this fixes bug #1126.



Modified: pkg/DatABEL/ChangeLog
===================================================================
--- pkg/DatABEL/ChangeLog	2014-03-14 23:44:17 UTC (rev 1639)
+++ pkg/DatABEL/ChangeLog	2014-03-15 00:03:29 UTC (rev 1640)
@@ -1,3 +1,8 @@
+**** v. 0.9-5
+
+- Fixed bug #1126: Using mach2databel() or impute2mach() to convert files
+  to the filevector format leaves fvtmp filles behind (Lennart)
+
 **** v. 0.9-4 (2013.03.12)
 
 - Fixing warning messages (Lennart)

Modified: pkg/DatABEL/R/text2databel.R
===================================================================
--- pkg/DatABEL/R/text2databel.R	2014-03-14 23:44:17 UTC (rev 1639)
+++ pkg/DatABEL/R/text2databel.R	2014-03-15 00:03:29 UTC (rev 1640)
@@ -43,6 +43,11 @@
 #' be opened in readonly mode
 #' @param naString the string used for missing data (default: NA)
 #'
+#' @param unlinkTmpTransposeFiles Boolean to indicate whether
+#' the intermediate "_fvtmp.fvi/d" files should be deleted. Default:
+#' TRUE. These intermediate files are generated while transposing the
+#' filevector files.
+#'
 #' @author  Yurii Aulchenko
 #'
 #' @return The converted file is stored in the file system, a
@@ -137,7 +142,7 @@
                          skipcols, skiprows, transpose=FALSE,
                          R_matrix=FALSE, type="DOUBLE",
                          cachesizeMb=64, readonly=TRUE,
-                         naString="NA")
+                         naString="NA", unlinkTmpTransposeFiles=TRUE)
 {
     if (missing(infile)) stop("input file name (infile) is required")
     if (missing(outfile))  outfile <- paste(infile, ".filevector", sep="")
@@ -184,5 +189,11 @@
     #print(charnames)
     #print(intnames)
     tmp <- .Call("text2fvf_R", charnames, intnames, package="DatABEL")
+
+    if (unlinkTmpTransposeFiles==TRUE) {
+        unlink(paste0(outfile, "_fvtmp.fvi"))
+        unlink(paste0(outfile, "_fvtmp.fvd"))
+    }
+
     return(databel(outfile, cachesizeMb=cachesizeMb, readonly=readonly))
 }



More information about the Genabel-commits mailing list