R:如何在远程服务器上使用sftp检查文件是否存在

时间:2019-01-04 22:11:15

标签: r ftp sftp rcurl geturl

如何在使用R的远程服务器中使用sftp检查文件是否存在。

服务器中缺少5个文件,其中2个丢失。因此,它将读取前两个文件,然后引发以下错误: Error in function (type, msg, asError = TRUE) : Could not open remote file for reading: No such file or directory 程序因获取错误而中断,并且不读取三个可用文件。

library("RCurl")
protocol <- "sftp"
server <- "data.google.com"
userpwd <- "xyz:xyz123"
fileName <- "abc.csv"
url <- paste0(protocol, "://", server, "/", fileName)
data <- getURL(url = url, userpwd = userpwd)

0 个答案:

没有答案