Re: --time-cond <file> with --remote-header-name?

Daniel Stenberg via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
On Sat, 27 Apr 2024, Paul Gilmartin via curl-users wrote:

> I would like to fetch a file with --remote-header-name depending on 
> -time-cond <file>
>
> I could use %{filename_effective} to get the filename, but that's available 
> only after the transfer, too late for -time-cond <file> to operate.
>
> Is there a way?

It really can't be done. Since curl needs to pass in the time for the 
condition already in the initial request, it needs to get that time from 
somewhere. Like a local file. You then need to tell it the name of the local 
file.

It can't first do a request to get to know the file name, as then it is 
already too late to get the time and included it in the request.

You can possibly do a --head request first to figure out the 
--remote-header-name file name, and then do a follow-up request and use that 
file name for --time-cond.

-- 

  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.