(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