Skip to contents

Downloads the archive once, whole, when its size is known and at most max_bytes, and reads its file names and sizes from that copy (a tar has no index that a partial download could read, see the top of this file). The copy is kept for the session, so members taken from it later need no further request.

Usage

.tar_peek(
  url,
  size = NULL,
  max_bytes = .tar_peek_max_bytes,
  cache = FALSE,
  skip_on_api_limit = FALSE
)

Arguments

url

the download URL of a .tar file, or the path of one on disk (then read directly, without any request)

size

the archive's size in bytes, from the repository's listing. An archive whose size is unknown or over max_bytes is not downloaded, and NULL is returned.

max_bytes

the largest archive that is downloaded to list it

cache

if TRUE, keep the listing on disk for later sessions (see zip_peek_cache_clear())

skip_on_api_limit

see download_repo_files()

Value

a data.frame with columns name, size and member (see .tar_list_file()), or NULL when the archive was not listed