Skip to contents

Generic implementing of how to download files from a connector:

Usage

download_cnt(connector_object, name, file = basename(name), ...)

# S3 method for class 'connector_fs'
download_cnt(connector_object, name, file = basename(name), ...)

Arguments

connector_object

connector The connector object to use.

name

character Name of the content to read, write, or remove. Typically the table name.

file

character Path to the file to download to or upload from

...

Additional arguments passed to the method for the individual connector.

Value

invisible file.

Examples

# Download file from a file storage
cnt <- connector_fs$new(tempdir())

cnt |>
  write_cnt("this is an example", "example.txt")

list.files(pattern = "example.txt")
#> character(0)

cnt |>
  download_cnt("example.txt")

list.files(pattern = "example.txt")
#> [1] "example.txt"
readLines("example.txt")
#> [1] "this is an example"

cnt |>
  remove_cnt("example.txt")