bs_cached: Cache, fetch, and list files from the BSRTO FTP server

Description Usage Arguments Value Examples

View source: R/bs-ftp.R

Description

Cache, fetch, and list files from the BSRTO FTP server

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bs_cached(
  x,
  ftp = bs_ftp_server(),
  cache = bs_cache_dir(),
  async = FALSE,
  retries = 4,
  quiet = FALSE
)

bs_ftp_list(
  x,
  pattern = NULL,
  recursive = FALSE,
  ftp = bs_ftp_server(),
  print = FALSE,
  quiet = FALSE
)

Arguments

x

A path relative to /pub/dfo

ftp

The location of the FTP server

cache

Path to a local copy of /pub/dfo where files will be cached or written.

async

Use TRUE to download files asynchronously (much faster for many small files)

retries

The number of retries to use

quiet

Use TRUE to suppress progress messages

pattern

A regular expression against which files are matched or NULL to match all files. See stringr::str_detect() for how this argument is interpreted.

recursive

Use TRUE to recurse directories

print

Use TRUE to print out matching files as the listings are downloaded.

Value

bs_cached() returns the file path to the local version of the file after downloading; bs_ftp_list() returns a list of files (not directories!) that match pattern.

Examples

1
2
3
4
5
## Not run: 
bs_cached("barrow/BarrowStraitDataSummary.xlsx")
bs_ftp_list("barrow")

## End(Not run)

paleolimbot/bsrto documentation built on Dec. 12, 2021, 5:44 a.m.