check_curl | R Documentation |
check_curl
will connect to a server, typically a (secure) file transfer protocol available with cURL and check for the presence of a file
with the provided pattern, if any.
check_curl(
connection = NULL,
handle_options = list(),
pattern = NULL,
detailed_output = FALSE
)
connection |
Character string that is used to connect to the desired file system (ensure ends with a /). |
handle_options |
List of names elements for the cURL handle (for sftp connections, typically username and password are provided). |
pattern |
Character string, typically a file name or portion thereof, that will be used in the search. Default is today's date. |
detailed_output |
Logical value to return the entire file list at remote location; default is |
This function is used in conjunction with the transfer_curl
function and can detect if the file of interest is actually available for download.
check_curl
is a thin wrapper around curl
functionality; more specifically, the core process uses curl_fetch_memory
. cURL requires
a 'handle' to be specified, which as the name suggests, specifies how cURL will 'handle' the server request. Details such as username, password, verbose can be specified
in the handle. See the examples for some common patterns.
A logical value of whether or not the pattern was found. If detailed_output, the entire list of files in target folder.
## Not run:
# Test to see if the pattern is present in the server.
check_curl(pattern = 'June_22_2020', connection = 'YOUR(S)FTPURL', detailed_output = TRUE)
check_curl(connection = 'YOUR(S)FTPURLPATH',
handle_options = list(username = 'myuid', password = 'mypwd', verbose = TRUE),
detailed_output = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.