1
連接我有用下面的代碼ftp服務器的連接:R:變化端口與SFTP服務器
url <- "ftp://MyServer"
userpwd <- "MyUser:MyPass"
filenames <- getURL(url, userpwd = userpwd, ftp.use.epsv = FALSE, dirlistonly = TRUE, port = 22)
filen <- "MyFile.csv"
rawdata <- getURL(paste(url, filen, sep = ""), userpwd = userpwd, crlf = TRUE)
該文件將被移動到SFTP服務器,所以我需要改變輸入。這種新的SFTP服務器通過端口22,而不是標準的端口21訪問在連接失敗,出現以下錯誤
Error in function (type, msg, asError = TRUE) :
Failed to connect to MyServer port 21: Connection refused
它採用了錯誤的端口的時刻,但我怎麼告訴R鍵選擇端口22?