R/file_read.R

Defines functions file_read

Documented in file_read

#' @rdname file_connections
#' @export
file_read <- function(file, mode = "r", filter = NULL, options = character()) {
  options <- validate_options(options)

  if (!inherits(archive, "connection")) {
    file <- file(file)
  }

  description <- glue::glue("file_read({desc})", desc = summary(file)$description)

  archive_read_(file, 1L, description, mode, archive_formats()["raw"], archive_filters()[filter], options, sz = 2^14)
}

Try the archive package in your browser

Any scripts or data that you put into this service are public.

archive documentation built on Sept. 18, 2023, 9:07 a.m.