Gerard <[EMAIL PROTECTED]> writes: >> In particular, if Wget chooses not to download a file because the >> local timestamp is still current, or because its size corresponds >> to that of the remote file, these should result in an exit status >> of zero. > > I disagree. If wget has not downloaded a file, exiting with zero > could lead the end user to believe that it had.
Specifying `-n' means "download if needed". There is no reason to report a non-zero exit status if there was no need to perform the download. It is simply not an error condition, it is one of the two success conditions (the other being download of the new contents). > I disagree again. If wget did not download a file, no matter what > the reason, then it should not exit with zero. I have written > several scripts that utilize wget to download files. Because wget > fails to issue a useful code upon completion, I am forced to use > hacks to find out what actually transpired. Curl utilizes certain > error codes, # 73 for instance, that are quite useful. I agree that Wget should allow the caller to find out what happened, but I don't think exit codes can be of much use there. For one, they don't allow distinction between different "successful" conditions, which is a problem in many cases. Also, their meaning is much harder to define in presence of multiple downloads (wget URL1 URL2...).
