sftp_rename: Rename a single file or single directory in an SFTP account

Description Usage Arguments Value See Also Examples

View source: R/sftp_functions.R

Description

Specify a current name and a new name, for a file or folder existing in an SFTP account. While folders must be empty when using sftp_removedir, that is not the case with sftp_rename - non-empty folders can be renamed. sftp_rename internally calls RCurl::curlPerform Questions? https://github.com/stenevang/sftp

Usage

1
2
3
4
5
6
7
8
sftp_rename(
  from,
  to,
  sftp_connection = sftp_con,
  verbose = TRUE,
  curlPerformVerbose = FALSE,
  curl_options = list()
)

Arguments

from

A single name of an existing file or folder. If a vector of names is supplied, only the first value will be used, and there will be a warning.

to

A single name of an existing file or folder. If a vector of names is supplied, only the first value will be used, and there will be a warning.

sftp_connection

A list object created by calling sftp_connect. Default is sftp_con.

verbose

Logical. Turn on messages to console. Default is TRUE

curlPerformVerbose

Logical. Turn on messages to console form curlPerform. 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_rename. Optional. Default is an empty list.

Value

The function returns TRUE if successful.

See Also

sftp_download, sftp_upload, sftp_delete, sftp

Examples

1
2
3
4
5
6
7
8
9
# minimal - rely on defaults
sftp_rename("oldname.csv", "newname.csv")

# explicit - rename a folder
sftp_rename(from = "old_folder_name",
            to = "new_folder_name",
            sftp_connection = sftp_con,
            verbose = TRUE,
            curlPerformVerbose = FALSE)

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