Create an remote directory using SFTP / RCurl

痞子三分冷 提交于 2019-12-02 10:27:07

问题


Is it possible to create a directory on an SFTP site using the RCurl package? I found the sftp_create_dirs function, but I could not find an example how to use it.

I tried to set the ftp.create.missing.dirs option to TRUE, as in

library(RCurl)
opts <- list(ftp.create.missing.dirs=TRUE, 
    ssh.public.keyfile = mypubkey, ssh.private.keyfile = myprivatekey)
ftpUpload("myfile.txt", "sftp://me@www.host.org/newdir/myfile.txt", .opts=opts)

This works if newdir exists, but fails if it does not exists.

Any hint appreciated!

来源:https://stackoverflow.com/questions/20181690/create-an-remote-directory-using-sftp-rcurl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!