sftp_list: List files and/or folders in an SFTP directory

Description Usage Arguments Value See Also Examples

View source: R/sftp_functions.R

Description

This function lists files, or folders, or both in the SFTP location specified by a list object created by calling sftp_connect. sftp_list internally calls RCurl::getURL Convenience wrapper functions are available: sftp_listfiles and sftp_listdirs Questions? https://github.com/stenevang/sftp

Usage

1
2
3
4
5
6
7
8
9
sftp_list(
  sftp_connection = sftp_con,
  verbose = TRUE,
  curlPerformVerbose = FALSE,
  encoding = "UTF-8",
  type = "all",
  recurse = F,
  curl_options = list()
)

Arguments

sftp_connection

A list created by calling sftp_connect Default value is sftp_con.

verbose

Logical. Turn on messages to console. Default is TRUE.

curlPerformVerbose

Logical. Turn on messages to console from RCurl::curlPerform. Default is FALSE.

encoding

Explicitly identifies the encoding of the content that is returned by the server in its response. Possible values are ‘UTF-8’ or ‘ISO-8859-1’. Default is 'UTF-8'.

type

One of "f", "file" (for list files), "d", "dir", "directory" (for list directories), "all" (for both files and directories, default).

recurse

Logical. Recurse directories? Default is FALSE.

curl_options

A list of named values with names as listed by RCurl::listCurlOptions. The values are handed to the .opts parameter of the RCurl function called by sftp_list. Optional. Default is an empty list.

Value

A dataframe

See Also

sftp_listfiles, sftp_listdirs, sftp

Examples

1
2
3
4
5
6
7
8
# minimal - rely on defaults
files_and_folders <- sftp_list(type = "all")

# explicit
files_and_folders <- sftp_list(sftp_connection = sftp_con,
                               verbose = TRUE,
                               curlPerformVerbose = FALSE,
                               type = "all")

stenevang/sftp documentation built on Feb. 8, 2022, 6:40 p.m.