Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

finalize

Call finalizer


Description

This calls the currently assigned finalizer, either via R's finalization mechanism or manually.

Usage

finalize(x, ...)
## S3 method for class 'ff_pointer'
finalize(x, ...)
## S3 method for class 'ff'
finalize(x, ...)
## S3 method for class 'ffdf'
finalize(x, ...)

Arguments

x

either an ff or ffdf object or an ff_pointer, see details

...

currently ignored

Details

The finalize.ff_pointer method is called from R after it had been passed to reg.finalizer. It will set the finalizer name to NULL and call the finalizer.
The finalize generic can be called manually on ff or ffdf objects. It will call the finalizer but not touch the finalizer name.
For more details see finalizer

Value

returns whatever the called finalizer returns, for ffdf a list with the finalization returns of each physical component is returned.

Note

finalize.ff_pointer MUST NEVER be called manually - neither directly nor by calling the generic on an ff_pointer (could erroneously signal that there is no pending finalization lurking around)

Author(s)

Jens Oehlschlägel

See Also

Examples

x <- ff(1:12, pattern="./finalizerdemo")
  fnam <- filename(x)
  finalizer(x)
  is.open(x)
  file.exists(fnam)

  finalize(x)

  finalizer(x)
  is.open(x)
  file.exists(fnam)

  delete(x)
  finalizer(x)
  is.open(x)
  file.exists(fnam)

  rm(x)
  gc()

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.