c - How to download entire directory in sftp using libcurl -



c - How to download entire directory in sftp using libcurl -

i programing in c. want download particular directory server (sftp) using libcurl. know can download file using next alternative how download directory. sftp wildcardmatch alternative not supported can download files in directory atleast.

curl_easy_setopt(curl, curlopt_writedata, fd);

platform: linux

you need explicitly list directory, , download every file within not . or .. (possibly recursing on sub directories).

so issue first request list directory. build (locally) array of entries obtained request. then, each such entry, issue request download file, or, if [sub-]directory, recurse inside.

and have issues if client of ftp server add together or delete files in same directory.

btw, ftp servers able e.g. archive entire directory foo/ if retrieve foo.tar.gz etc..

c linux curl libcurl sftp

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -