import_file: Download file from cloud to local system

Description Usage Arguments Value Examples

View source: R/import_file.R

Description

Save a single file from the cloud to your local drive

Usage

1
2
3
import_file(bucketpath, localfile, data_source = flyio_get_datasource(),
  bucket = flyio_get_bucket(data_source), overwrite = TRUE,
  show_progress = FALSE, ...)

Arguments

bucketpath

path of file in the bucket

localfile

path where the file needs to be downloaded. The file name and extension also need to be present; if not, the current file name will be considered

data_source

the name of the data source, if not set globally, gcs or s3

bucket

the name of the bucket, if not set globally

overwrite

logical. If the files should be overwritten if already present

show_progress

logical. Shows progress of the download operation

...

other parameters for gcs_get_object or save_object

Value

the filename and path of the object saved to local

Examples

1
2
3
4
5
6
7
## Not run: 
# import data from GCS to Local
flyio_set_datasource("gcs")
flyio_set_bucket("your-bucket-name")
import_file("mtcars.csv", paste0(tempdir(), "/mtcars.csv"), overwrite = T)

## End(Not run)

socialcopsdev/flyio documentation built on Feb. 15, 2020, 11:15 p.m.