Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top