tarListCallback: Callback function to gather information about entries in a...

View source: R/Rtar.R

tarListCallbackR Documentation

Callback function to gather information about entries in a gzipped tar file.

Description

This is a function that returns two functions that can be used in a call to tarInfo to collect the information about each entry in a gzipped tar archive. The first function is called for each entry and combines the information for it with previously processed entries. The second function converts the data into a data frame, transforming time information into POSIXct values and mapping internal type identifiers for the entries into human-readable types, e.g. DIRTYPE, REGTYPE, ...

Usage

tarListCallback()

Value

A list of two functions

callback

the function that is to be invoked for each entry as it is encountered

.ans

the function to retrieve the answer. This can be return the data as a simple list if it is called with the argument FALSE

The list of functions is given a class TarInfoCallback to identify it as being a pair that tarInfo can use together.

Author(s)

Duncan Temple Lang

See Also

tarInfo

Examples

  filename = system.file("sampleData", "OmegahatXSL_0.2-0.tar.gz", package = "Rcompression")
  f = tarListCallback()
  invisible(tarInfo(filename, f$callback))
  f$.ans()

omegahat/Rcompression documentation built on Nov. 29, 2023, 12:45 a.m.