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

View source: R/sftp.R

sftp_renameR Documentation

Rename a single file or single directory in an SFTP account

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.

Usage

sftp_rename(
  from,
  to,
  sftp_connection = get("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.

Author(s)

Theodor Stenevang Klemming

See Also

sftp_download, sftp_upload, sftp_delete

Other sftp: sftp_changedir(), sftp_connect(), sftp_delete(), sftp_download(), sftp_listdirs(), sftp_listfiles(), sftp_list(), sftp_makedir(), sftp_removedir(), sftp_upload()

Examples


## Not run: 
# 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)

## End(Not run)


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.