Hide Forgot
Description of problem: # wget -O /etc/resolv.conf "http://people.redhat.com/gbarros/blah" will truncate the output file before doing the dns lookup, thus failing and trashing the file. open("/etc/resolv.conf", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3 Version-Release number of selected component (if applicable): wget-1.11.4-2.el5_4.1.x86_64 How reproducible: every time Steps to Reproduce: 1. wget -O /etc/resolv.conf "http://people.redhat.com/gbarros/blah" Actual results: -O file gets clobbered Expected results: File is downloaded to a temporary location and moved into place when the download is complete.
That's expected and documented behaviour, this is from the man page: Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there.