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. Questions? https://github.com/stenevang/sftp

Usage

1
2
sftp_rename(from, to, sftp_connection = sftp_con, verbose = TRUE,
  curlPerformVerbose = FALSE)

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.

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 Oct. 25, 2019, 5:16 a.m.