我正在使用curl从FTPS网站下载一些文件。当我将文件从网站下载到我的计算机上时,zip文件的日期会更改为下载的时间和日期。我想保留在FTPS服务器上的原始时间戳。
请指导如何做到这一点。如果您能提供示例,那就太好了,因为我是curl的新手。
谢谢。
关键在于这个命令行选项:
-R/--remote-time
When used, this will make libcurl attempt to figure out the
timestamp of the remote file, and if that is available make
the local file get that same timestamp.
...然后可以像这样使用:
curl -R -O --ssl ftp://example.com/that/file/I/want.txt
(--ssl曾被称为--ftp-ssl)
sudo curl ...
来避免出现“Failed to set filetime: Operation not permitted”的错误。 - undefined