curl-library
About FTP and SFTP
Date: Wed, 6 May 2009 13:41:30 +0800
Hi everyone,
Now i am studying using libcurl ro implement FTP/SFTP transfer, but there are two problems:
(1) I installedf curl-7.19.4 and found some examples like "ftpget.c" and "ftpupload.c", both of them work well; but I want to know How i could implement FTP manipulation like "delete_file", "delete_dir", "dir_remote" and "create_dir"? I checked the Token "CURLOPT", but did not find any clue.
(2) I know that Libcurl needs libssh2 to support SFTP, so I downloaded libssh2-1.1 and openssl-0.9.8k(dependency of libssh2-1.1)£¬but installation failed due to a compiling error like below:
gcc -shared -Wl,-M -Wl,.libs/libssh2.so.1.0.1.exp -Wl,-h -Wl,libssh2.so.1 -o .libs/libssh2.so.1.0.1 .libs/channel.o .libs/comp.o .libs/crypt.o .libs/hostkey.o .libs/kex.o .libs/mac.o .libs/misc.o .libs/packet.o .libs/publickey.o .libs/scp.o .libs/session.o .libs/sftp.o .libs/userauth.o .libs/transport.o .libs/version.o .libs/openssl.o -L/home/xiaolech/Open_SSL/lib -lssl -lcrypto -lz -lnsl -lsocket -lc
unknown> 0x90 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xa0 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xa8 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xac /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xb4 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xb8 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
x509_name_ff 0xcc /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
<unknown> 0xd4 /home/xiaolech/Open_SSL/lib/libcrypto.a(x_name.o)
...
ld: fatal: relocations remain against allocatable but non-writable sections
I am not very clear about how to resolve it, any body knows?
Thanks a lot!
Regards,
Atlantis
Received on 2009-05-06