bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] execute external command only if download occurs with tim


From: Micah Cowan
Subject: Re: [Bug-wget] execute external command only if download occurs with time stamping
Date: Thu, 21 Oct 2010 16:53:13 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9

(10/21/2010 10:18 AM), Tony Lewis wrote:
> Kamenik, Aleksander wrote:
> 
>> So wget -N always retuns 0 on success (tested 1.12 too). Success is both
>> downloading a file and not downloading it due to current timestamp.
> 
> I think it would be useful for wget to distinguish between these two use 
> cases. I would be happy if -N without a download always set the error code to 
> 1, but I suppose that might break existing scripts so perhaps a command line 
> option is needed. (I sat here trying to come up with a meaningful name for 
> that option, but I had no flash of inspiration.)

Not sure the exit status is the best place to do that, though. Both
cases really are success cases, and and should be treated as such. It's
a pity that there is only one possible success status, while there are
255 possible failure statuses.

One could always save away timestamp and length information (and
possibly a checksum) from the original, and then compare afterwards to
see if there was a change. Not ideal, I agree, but personally I dislike
the idea of adding command-line flags to change what the exit statuses
will mean, particularly since in wget's case there may be a good variety
of similar cases. Of course, if Giuseppe wants to do that, it's his call.

-- 
Micah J. Cowan
http://micah.cowan.name/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]