OneDrive files must be downloaded before they can be accessed. This function takes a number of steps to extract a file from the respective cloud location and returns the local path to access the file as necessary. To avoid redundancy, files are stored in the current temporary R directory which is cleaned when the session is ended. The time stamp of the local copy of the file is always checked before any reading is done to minimize downloads as necessary.

get_cloud_file(con, .close = FALSE)

Arguments

con

A cloud_file connection object

.close

Boolean - whether or not to close the input file connection

Value

Local filename of the desired file in the R temporary directory

Examples

if (FALSE) {
sp_file <- sharepoint_file('/some/sharepoint/file.txt')
get_cloud_file(sp_file)
}