0
私は簡単な例があります:「テスト」は、サーバ内のファイルから属性をどのようにダウンロードファイルに設定する最後に変更されたフィールドおよびダウンロードファイル
include <curl/curl.h>
char tmp[] = "/var/tmp/tmp";
char fullpath[] = "/var/tmp/test";
FILE* fp;
CURL* curl;
char bufferError[CURL_ERROR_SIZE];
CURLcode result;
int main() {
curl = curl_easy_init();
fp = fopen(tmp, "wb");
char url[] = "http://10.100.1.5/promorolik/Skoro_Shrek_4_obrez.mp4";
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, bufferError);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_HEADER, 0);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
fclose(fp);
rename(tmp, fullpath);
return 0;
}
を? (最終修正フィールドからのファイルの作成時間)?