Subject: | 'lwp' said it fetched '/home/somefile', but it was not created |
Date: | Wed, 12 Dec 2007 09:51:42 +0300 |
To: | bug-file-fetch [...] rt.cpan.org |
From: | Денис Кольвах <dendvk [...] mail.ru> |
Hello guys.
I've encounter such issue. What does it mean?
Here is a part of my script:
use File::Fetch;
$File::Fetch::TIMEOUT = 5;
$File::Fetch::WARN = undef;
$File::Fetch::DEBUG = undef;
$File::Fetch::BLACKLIST = [qw|lynx wget curl|];
foreach my $h (@hosts) {
my $uri = $h->{proto}.$h->{host}.$h->{tld}.$h->{doc_root}.$h->{file};
my $path = $pwd.$h->{host}.$h->{tld};
unlink $path.'/'.$h->{file};
print "\n\nTrying $uri ...\n";
my $i = 1;
my $ff = File::Fetch->new(uri => $uri);
my $status = undef;
while($i <= 3) {
$status = $ff->fetch(to => $path);
last if($status);
$i++;
sleep $opt{wait};
}
}
Sometimes (not often) this foreach give me error described in subject of my
letter, and after this does not fetch anymore, empty error came from
$ff->fetch for all rest files to download.
How can I cure this situation? Should I not use lwp at all, or create new
File::Fetch object for each file from list?
--
С уважением,
Денис Кольвах mailto:dendvk@mail.ru