【问题标题】:rm working with curl but not with rcurlrm 使用 curl 但不使用 rcurl
【发布时间】:2014-01-06 17:55:46
【问题描述】:

在我有的命令行上:

curl -u user:pass sftp://xx.xx.xx.20:22/ -k --quote "-rm /test.txt"

在 R 中我有:

curlPerform(url="sftp://xx.xx.xx.20:22/", prequote="rm /test.txt", ssl.verifypeer = FALSE, userpwd = "user:pass")

据我所知,这两者是相同的,当我执行两者时,我会看到目录列表输出。但是,当我从命令行执行时,test.txt 会被删除。当我在 R 中执行时,输出后面是

OK
 0

test.txt 仍保留在远程计算机上。

【问题讨论】:

  • 我不确定--quoteprequote 之间的区别,但您以-rm 开头的--quote 和以rm 开头的prequote(不带连字符)。
  • 好收获。它在 R 中与postquote 一起工作。所以我认为 curl 中的破折号与 rcurl 中的 postquote 相同。

标签: r curl rcurl


【解决方案1】:

这行得通。

curlPerform(url="sftp://xx.xx.xx.20:22/", postquote="rm /test.txt", ssl.verifypeer = FALSE, userpwd = "user:pass")

所以我假设postquote 模仿curl 中命令之前的破折号。如果有人可以验证这一点,我会很高兴。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-10
    • 1970-01-01
    • 1970-01-01
    • 2019-11-22
    • 2019-11-20
    • 2021-12-03
    相关资源
    最近更新 更多