in reply to lwp-download program
There are two basic ways to check whether a file exists before clobbering it. You can use stat or its little cousin -e on the filename before opening, or else you can call sysopen with the O_EXCL flag set and catch the error when the file exists.
As near as I can see, lwp-download is a one-shot program not designed for downloading multiple files. In your wrapper, you could accept a list of urls from the command line and loop through calls to lwp-download. I don't know why you are getting only one getFile() call through unless you are hitting some fatal error in the first call.
Why don't you just call lwp-download through system instead of pasting it into a subroutine? I'm very suspicious of that procedure, there are lots of traps you can trip doing that.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: lwp-download program
by pccode (Novice) on May 29, 2005 at 20:24 UTC | |
by pccode (Novice) on May 29, 2005 at 20:32 UTC |