000.baseLoad: Loads an object from a file connection

Description Usage Arguments Details Value See Also


Loads an object from a file connection similar to load(), but without resetting file connections (to position zero).

WARNING: This is an internal function that should not be called by anything but the internal code of the R.cache package.


.baseLoad(con, envir=parent.frame())



A connection.


An environment where the loaded object will be stored.


The reason why it is not possible to use load() is that that resets the file position of the connection before trying to load the object. The reason why that happens is because when you pass a regular file connection to load() it gets coerced via gzcon(), which is the function that resets the file position.

The workaround is to creat a local copy of base::load() and modify it by dropping the gzcon() coersion. This is possible because this function, that is .baseLoad(), is always called with a gzfile() connection.


Returns (invisible) a character vector of the names of objects loaded.

See Also

This function is used by loadCache() and readCacheHeader().

Search within the R.cache package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.