Skip to main content

Command Palette

Search for a command to run...

Using curl in Windows to download files

Updated
1 min read

This downloads a file if it's newer than the one that's on your local drive:

curl -z "path\filename.lib" ftp://ftp.yoursite.com//ftppath/filename.lib -o "path\filename.lib"

The "-z" means only copy if it's newer than a specified date. But then you just put the filename, meaning that curl should use the date of that file. If the file doesn't exist locally, you'll get a warning about "invalid date or not a file". This can be ignored. The "-o" means download it to the local file specified (same filename as for -z), instead of just outputting it to the console.

More from this blog

Roderick's Debug Diary

58 posts

https://mastodon.social/@rvkennedy