> On December 09, 2007 at 07:03PM Stuart Moore wrote: > Could the exit code used be determined by a flag? E.g. by default it > uses unix convention, 0 for any success; with an > --extended_error_codes flag or similar then it uses extra error codes > depending on the type of success (but for sanity uses the same codes > for failure with or without the flag) > > That should allow both of you to use it for scripting.
Curl has a "-w" option that takes several different variables. I presently use the 'http_code' and 'size_download' variables to gather information I need to determine what exactly transpired. They are also great for debugging a script; however, that is another matter. Presently, I direct this info to a file and then grep the file to gather the information I need. It works faster than doing multiple file comparisons, especially when the files are compressed. If wget were to implement something along this line, possibly even setting a specific variable indicating whether or not a file was downloaded, it would make scripting a lot easier and less prone to breakage. Curl presently has one of the best exit code implementations available. Studying their model would seem like a worth while venture. -- Gerard