【发布时间】:2018-09-11 15:16:48
【问题描述】:
我尝试将一个小文件 ftp 上传到我 必须 与“活动”ftp(curl -P 选项)一起使用的 ftp 服务器,我的 R 会话转储核心。知道这里发生了什么,我必须将哪些选项传递给RCurl::ftpUpload()?
.opts <- list("verbose" = TRUE, "ftp.use.epsv" = FALSE,
"ftp.use.eprt" = TRUE, "connecttimeout" = 3, ftpport=TRUE)
myfile <- "path/myfile.json"
file.exists(myfile) # returns TRUE
cmd <- sprintf("ftp://%s:%s@myserver.de/mytargetdir/%s",
Sys.getenv("R__ftpuser"), Sys.getenv("R__ftppw"),
basename(myfile))
ftpUpload(myfile, cmd, .opts=.opts)
* 发现段错误 * 地址 0x1,导致“内存未映射”
Traceback:
1: curlPerform(url = to, upload = TRUE, readfunction = uploadFunctionHandler(file, asText), ..., curl = curl)
2: ftpUpload(myfile, cmd, .opts = .opts)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
我的 R 会话:
R version 3.4.4 (2018-03-15) for linux
RCurl version 1.95-4.11
命令行调用有效:
curl -P - myfile ftp://... -T --disable-eprt #uploads the file
我的卷发:
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
当我离开 ftpport=TRUE 选项时,会出现超时。
R --vanilla 也会发生这种情况
【问题讨论】:
-
确保您使用的是最新版本的 RCurl;我有
packageVersion("RCurl")为我返回[1] '1.95.4.11'。这可能需要维护者进行修复,因此您应该联系他们maintainer("RCurl"),最好使用完全可重现的示例。 curl 包是否提供类似的功能?