Skip to content

Q: ffsave/ffload between Linux and Windows

1 message · Jens Oehlschlägel

#
Patrick,

I don't have a quick solution using ffsave/ffload. However, are you 
aware that you can open an ff file from a previous session just by

a) make sure the ff file is not removed upon session end (create it 
outside fftemp)

b) make sure you have stored the R side ff object

Look at this:

# create ff outside fftemp
 > x <- ff(1:12, file="fftest")
# see finalizer changed from 'delete' to 'close'
 > finalizer(x)
[1] "close"
# see filename
 > filename(x)
[1] "C:/Users/jens/Documents/fftest"
# close file
 > close(x)
[1] TRUE
# plug-in wrong filepathname but do not use: filename(x) <- newname
 > physical(x)$filename <- "C:/Users/jens/Documents/fftest2"
# try open: can't find file anymore
 > open(x)
Fehler: file.access(filename, 0) == 0 ist nicht TRUE
 > x
ff (deleted) integer length=12 (12)
# plug-in correct filepathname but do not use: filename(x) <- newname
 > physical(x)$filename <- "C:/Users/jens/Documents/fftest"
 > open(x)
[1] TRUE
 > x
ff (open) integer length=12 (12)
  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9] [10] [11] [12]
    1    2    3    4    5    6    7    8    9   10   11   12

With this you can easily migrate any ff objects to new locations

HTH
Jens

Am 10.01.2015 18:45, schrieb Patrick Zhang: