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
In reply to Re: lwp-download program
by Zaxo
in thread lwp-download program
by pccode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |