scp_upload and scp_download both make use of normalizePath with mustWork = TRUE (here and here)
normalizePath throws errors for valid paths if it cannot read every single underlying directory. This is documented in the Value section for normalizePath. For SMB shares, access to underlying directories is often denied.
This causes scp_upload and scp_download to fail if the local source or destination is a directory with no access to the underlying directory, with Error in normalizePath(path.expand(path), winslash, mustWork) : Access is denied, even if the directory is valid and the user has read and write permissions on that directory.
Please consider removing the mustWork = TRUE, ideally replacing it with mustWork = FALSE to reduce unneeded warnings, and add a different way of verifying the location is a valid directory (e.g. use file.info).
Alternatively, consider adding an argument to allow users to use these functions without stopping on a normalizePath failure.
scp_uploadandscp_downloadboth make use ofnormalizePathwithmustWork = TRUE(here and here)normalizePaththrows errors for valid paths if it cannot read every single underlying directory. This is documented in the Value section fornormalizePath. For SMB shares, access to underlying directories is often denied.This causes
scp_uploadandscp_downloadto fail if the local source or destination is a directory with no access to the underlying directory, withError in normalizePath(path.expand(path), winslash, mustWork) : Access is denied, even if the directory is valid and the user has read and write permissions on that directory.Please consider removing the
mustWork = TRUE, ideally replacing it withmustWork = FALSEto reduce unneeded warnings, and add a different way of verifying the location is a valid directory (e.g. usefile.info).Alternatively, consider adding an argument to allow users to use these functions without stopping on a
normalizePathfailure.