[R] ff objects saving problem

Xiaobo Gu guxiaobo1982 at gmail.com
Thu Nov 11 05:52:29 CET 2010


Hi Jens,
I have installed RTools, on my Win XP SP3 notebook, there are still
errors when running the examples,


> cat("let's create some ff objects\n")
let's create some ff objects
> n <- 8e3
> a <- ff(sample(n, n, TRUE), vmode="integer", length=n, filename="d:/tmp/a.ff")
> b <- ff(sample(255, n, TRUE), vmode="ubyte", length=n, filename="d:/tmp/b.ff")
> x <- ff(sample(255, n, TRUE), vmode="ubyte", length=n, filename="d:/tmp/x.ff")
> y <- ff(sample(255, n, TRUE), vmode="ubyte", length=n, filename="d:/tmp/y.ff")
> z <- ff(sample(255, n, TRUE), vmode="ubyte", length=n, filename="d:/tmp/z.ff")
> df <- ffdf(x=x, y=y, z=z)
> rm(x,y,z)
> cat("save all of them\n")
save all of them
> ffsave.image("d:/tmp/x")
[1] "d:/tmp/a.ff" "d:/tmp/b.ff" "d:/tmp/x.ff" "d:/tmp/y.ff" "d:/tmp/z.ff"
Error in ffsave(list = ls(envir = .GlobalEnv, all.names = TRUE), file
= outfile,  :
  the previous files do not match the rootpath (case sensitive)
> str(ffinfo("d:/tmp/x"))
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning messages:
1: In file.remove(c(imgfile, zipfile)) :
  cannot remove file 'd:/tmp/xTmp.ffData', reason 'No such file or directory'
2: In readChar(con, 5L, useBytes = TRUE) :
  cannot open compressed file 'd:/tmp/x.RData', probable reason 'No
such file or directory'
> cat("save some of them with shorter relative pathnames ...\n")
save some of them with shorter relative pathnames ...
> ffsave(a, b, file="d:/tmp/y", rootpath="d:/tmp")
[1] ""                                            "zip error: Nothing
to do! (d:/tmp/y.ffData)"
> str(ffinfo("d:/tmp/y"))
List of 3
 $ RData   :List of 2
  ..$ a: chr "d:/tmp/a.ff"
  ..$ b: chr "d:/tmp/b.ff"
 $ ffData  :List of 1
  ..$ zipinfo:  cannot find either d:/tmp/y.ffData or d:/tmp: chr
"y.ffData.zip."
 $ rootpath: chr "d:/tmp/"
>


2010/11/11 "Jens Oehlschlägel" <jens.oehlschlaegel at truecluster.com>:
> Xiaobo,
>
> You indeed need external 'zip' and 'unzip' utlities in the path, citing from ffsave's help: "using an external zip utility, e.g. for windows in Rtools on [http://www.murdoch-sutherland.com/Rtools/]".
>
> Please note that the mentioned utilities have a 4 GB limit for the zip file, AFAIK. I will for the next release check for a way to get rid of this limit and also to get rid of inconsistencies in upper/lower-case spelling of drive letters which can cause ffsave to fail. Note that - even without fffsave - ff objects can be made permanent simply by creating them with 'filename' resp. 'pattern' outside of fftempdir and saving the R-side ff-object with the usual 'save' or 'save.image' function.
>
> In a new R session, after 'library(ff)' and 'load' you again have access, assumed your ff files are still in the same location.
> And yes, each column of a ffdf dataframe is stored as a separate ff file.
>
> Jens Oehlschlägel
>



More information about the R-help mailing list