sftp_makedir: Create a new directory in an SFTP account

View source: R/sftp.R

sftp_makedirR Documentation

Create a new directory in an SFTP account

Description

Create one or several directories (subdirectories) in an SFTP account. The function uses connection credentials from a list object created by calling sftp_connect.

Usage

sftp_makedir(
  foldername,
  sftp_connection = get("sftp_con"),
  verbose = TRUE,
  curlPerformVerbose = FALSE
)

Arguments

foldername

A character vector of length 1 or more containing the names of folders you want to create. The folder(s) will be created below the folder where you are currently standing according to the sftp connection list object you are using (default 'stfp_con'). A folder with subfolder and subsubfolder etc can be created in one single operation by supplying a path, like "folder1/folder2/folder3".

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 the number of new folders created.

Author(s)

Theodor Stenevang Klemming

See Also

sftp_removedir, sftp_rename, sftp_changedir

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

Examples


## Not run: 
# minimal - create one folder, rely on defaults
sftp_makedir("great_folder_name")

# explicit - create a multi-level path
sftp_makedir(foldername = "level1/folder2/directory3",
             sftp_connection = sftp_con,
             verbose = TRUE,
             curlPerformVerbose = FALSE)

 # create new folders as specified in a vector with names
 sftp_makedir(newfolders$names)

## End(Not run)


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