bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Will "-O xxx" option ALWAYS create xxx file?


From: Toni Verdu Carbo
Subject: Re: [Bug-wget] Will "-O xxx" option ALWAYS create xxx file?
Date: Sat, 2 Oct 2010 11:48:41 +0200 (CEST)

Thanks for your answer.

I already discovered what was happening. In some cases wget toke a lot of
time, so next invocation of the script (via cron) was happening while the
previous one did not finish. Since I was using a unique name for xxx file,
having two wget -O xxx commands executing at the same time gave the
undesired results.


That should never be necessary, at least not on any Unix-like system.

Opening the -O file happens very early on; I can't really imagine what
could cause it not to be created, apart from file permission or
invocation errors on the command line. But hey, when you tell Wget not
to tell you why it can't write a file (what the -q does), then I suppose
you're left to guess.

Wget's -q is a bit overzealous, really: a good -q option ought still to
report important errors, but quiet the rest of the output; Wget doesn't
really have such a mode.

-mjc

(10/01/2010 01:07 PM), address@hidden wrote:
Toni:

Make sure that you are looking in right directory for the file.  I don't recall exactly, 
but wget may either leave the file in the directory that the command "wget" is 
run from, or it may leave it in the directory that the command file actually exists in.

To make sure it winds up where you want, just use the exact location of the file, including all the 
directories all the way down to the root directory and not just the file name.  Use 
"/mydirectory/myotherdirectories/etc/xxx" and not just "xxx".

Paul

-----Original Message-----
From: "Toni Verdu Carbo" <address@hidden>
Sent: Thursday, September 30, 2010 3:44am
To: address@hidden
Subject: [Bug-wget] Will "-O xxx" option ALWAYS create xxx file?

        Hi,

        I'm using wget (v1.10.2 on Ubuntu 8.04 LTS server). Is it possible
that using "-O xxx" option xxx file is NOT created??

        I'm using wget in an cron script to periodically download some file
with "wget -qO xxx url", and I was assuming that the file xxx would be
ALWAYS created, regardless of the result of the download, and the code after
wget was assuming that. So I was not doing any test to assure xxx did really
exist. But from time to time it seems that wget fails to create the file and
the following code reports "file xxx doesn't exist" type errors...

        For instance:

        wget -qO xxx "http://..."; # any URL
        ls xxx

most of times work, but sometimes it gives an error message "ls: cannot
access xxx: No such file or directory". Does this make sense?

        Of course I can add some test for the existence of the xxx file
after wget use, but the question is: is there any situation where "wget -qO
xxx ..." could NOT create file xxx, or the file should be created in ANY
situation?

        Thanks in advance,

        Toni




Sent from Finest Planet WebMail.




--
Micah J. Cowan
http://micah.cowan.name/


--
Toni Verdu Carbo
Departament d'Arquitectura i Tecnologia de Computadors (ATC)
Departament d'Enginyeria Electrica, Electronica i Automatica (EEEA)
Escola Politecnica Superior (EPS)- Universitat de Girona (UdG)
Girona - Catalunya - Spain - Europe - Earth - Milky Way - Universe ;^D

http://maps.google.com/maps?q=41.963248,%202.832033&t=h



reply via email to

[Prev in Thread] Current Thread [Next in Thread]