sftp_delete: Delete files in an SFTP account

Description Usage Arguments Value See Also Examples

View source: R/sftp_functions.R

Description

Specify a file name or a vector of file names to delete in an SFTP account. Questions? https://github.com/stenevang/sftp

Usage

1
2
sftp_delete(file, sftp_connection = sftp_con, verbose = TRUE,
  curlPerformVerbose = FALSE)

Arguments

file

A vector of one or more file names that exist on the SFTP url. Wildcard is not supported in order to minimize the risk of accidental deletion. When a large portion of the files currently on the SFTP url needs to be deleted, you can create an input value for file by using sftp_listfiles. Note! Folders (directories) cannot be deleted. See instead sftp_removedir

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 files deleted.

See Also

sftp_download, sftp_upload, sftp_rename, sftp

Examples

1
2
3
4
5
6
7
8
# minimal - delete single file and rely on defaults
sftp_delete("my_bad_file.csv")

# explicit - delete several files in a vector
sftp_delete(file = files$name,
            sftp_connection = sftp_con,
            verbose = TRUE,
            curlPerformVerbose = FALSE)

stenevang/sftp documentation built on Oct. 25, 2019, 5:16 a.m.