> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Michael Wood > Sent: Friday, October 16, 2009 4:34 PM > To: libcurl development > Subject: Re: libcurl and libssh2 > > 2009/10/16 Xu, Qiang (FXSGSC) <[email protected]>: > > [...] > > Althought it is working, there are some problems. > > > > 1. It won't work when the path to the file is written as "~/scan/test.txt". > > This is not something I can help you with. Maybe a mailing list for > libssh2 would be a better place to ask about it?
Maybe, it is because SFTP protocol doesn't specify what ~ represents. But it works when I uploaded a file using "./curl -v -u qxu:fair123 -T CMakeLists.txt sftp://13.198.98.190/~/scan/test.txt", as Guenter suggested. Kind of strange here. > > 2. Why the root directory of the sftp server is listed? In > > my quoted command, there isn't anything related to "ls". > > This is because curl is designed to get or put stuff. In my > opinion, the -Q option was added on because it's useful, but > curl is not really designed for doing that sort of thing. So > your command above basically means, please fetch me > sftp://13.198.98.190, but before you do that, please send > through "rm /home/qxu/scan/test.txt". > > So even if you have the -Q, it will still send back the same > thing as if you did not have the -Q there. Your analysis sounds reasonable. :-) > > 3. It won't work when I want to remove a folder: > > [...] > > I can confirm the folder /home/qxu/scan/DOC.XSM does exist. > > Can't I use "rm -rf" to remove a folder? What else shall I use? > > Those quote commands are not shell commands. They are SFTP > protocol commands (or something like that). So you can > probably not use "rm -rf". But I don't know what you can use > instead. You will probably have to ask the libssh2 people. Just want to say thank you very much for your help all along. You are patient and nice. Thanks a lot, Xu Qiang ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
