wget (currently) compares the following things between the server and local file system: file name, file size, and modification time. If all three match and the --timestamping option is used, the file will not be downloaded from the server. None of those things will match in the case you mention.
It seems that you're suggesting assuming that X.tar is a match for X.tar.gz regardless of file size and modification time. If that's the case, when would wget ever know that it should download X.tar.gz because it has changed? I can see two ways to approach the feature you're suggesting: 1) if a local file exists without the .gz extension, gzip the local file and compare just the size of the two files; 2) download the file from the server, unzip it, compare the result, if the same, delete the downloaded file. It seems to me that number 2 is the only safe way to do it, but it's probably not what you're looking for. If you want to have a go at this, look for opt.timestamping in ftp.c. Hope that helps! -----Original Message----- From: bob stephens [contr] [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 10:06 AM To: [EMAIL PROTECTED] Subject: possible bug/addition to wget Hi WGet folks, This isnt really a bug I found in the operation of wget, but I think it is a functionality problem. I wonder if you can help me. I would like to use wget to mirror an ftp site - this step seems easy. BUT, I would like to set it up so that the files on my end are un- gzipped. When I did this step, of course it goes and looks for the gzipped file, doesnt find it and then goes ahead and redownloads the file. Is there a way to make it smart enough to see that the file exists in an alternate form. I can fix it if you can give me a clue as to where to look in the code - in the compare files section of ftp.c it looks like it does the comparison using strcmp - but maybe it could be changed to say "if the file has the extension gz (or Z or zip), then look for the file without the extension too. Does this sound dooable - it seems to me like it would be a useful modification. I was hoping I wouldnt have to get the .listing file and make the modifications in there. Thanks alot, Bob
