sftp_changedir: Move to another directory in an SFTP account

View source: R/sftp.R

sftp_changedirR Documentation

Move to another directory in an SFTP account

Description

Change your "current directory" used by the sftp functions. The function uses and modifies the connection credentials in a list object created by calling sftp_connect.

Usage

sftp_changedir(
  tofolder,
  current_connection_name = "sftp_con",
  verbose = TRUE,
  curlPerformVerbose = FALSE
)

Arguments

tofolder

A character vector of length 1 containing the name of a folder to where you want to go. The folder(s) will be looked for below the folder where you are currently standing according to the sftp connection list object you are using (default 'stfp_con'). A subfolder (or a sub-subfolder, etc.) can be specified in one single operation by supplying a path, like "folder1/folder2/folder3". To move up one level in the folder hierarchy, use "../". To go to the root folder, use "root".

current_connection_name

A string giving the name of the SFTP connection list object currently used, 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 after successful change of directory.

Author(s)

Theodor Stenevang Klemming

See Also

sftp_makedir, sftp_removedir, sftp_rename

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

Examples


## Not run: 
# minimal - move up one level, rely on defaults
sftp_changedir("..")

# minimal - to to root, rely on defaults
sftp_changedir("root")

# explicit - change to a directory at the end of a multi-level path
sftp_changedir(tofolder = "level1/folder2/directory3",
               current_connection_name = "sftp_con",
               verbose = TRUE,
               curlPerformVerbose = FALSE)

## End(Not run)


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