문제

on the command line I have:

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

and in R I have:

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

As far as I can tell the two are identical, and I see the directory listing output when I execute both. However, when I execute from the command line test.txt gets removed. When I execute in R the output is followed by

OK
 0

and test.txt remains on the remote machine.

도움이 되었습니까?

해결책

This works.

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

So I am assuming that postquote mimics the dash before the command in curl. I would love if someone could verify that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top