From 985d664bf27762902b93a2158e755aeabe6ee27f Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 31 Jan 2001 10:57:52 +0000 Subject: [PATCH] Added control on some "open" call (with 'or die ...') --- helm/http_getter/http_getter.pl.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/http_getter/http_getter.pl.in b/helm/http_getter/http_getter.pl.in index 674757642..43c7ff079 100755 --- a/helm/http_getter/http_getter.pl.in +++ b/helm/http_getter/http_getter.pl.in @@ -219,7 +219,7 @@ EOT print "DTD: $inputuri ==> ($filename)\n"; if (stat($filename)) { print "Using local copy\n"; - open(FD, $filename); + open(FD, $filename) or die "Cannot open $filename\n"; $cont = ""; while() { $cont .= $_; } close(FD); @@ -346,7 +346,7 @@ sub download if ($localfname =~ /\.xml\.gz$/) { # deflating cached file and return it $cont = gunzip($localfname); } elsif ($localfname =~ /\.xml$/) { # just return cached file - open(FD, $localfname); + open(FD, $localfname) or die "Cannot open $localfname"; while() { $cont .= $_; } close(FD); } else { # error @@ -365,7 +365,7 @@ sub download # print "Storing the $str file\n"; mkdirs($filename); - open(FD, ">".$filename.".tmp"); + open(FD, ">".$filename.".tmp") or die "Cannot open $filename.tmp\n"; print FD $cont; close(FD); @@ -378,7 +378,7 @@ sub download $cont = gunzip($filename); } elsif (($cachemode eq 'normal') and ($resourcetype eq 'gzipped')) { # deflate cache entry # and update $cont - open(FD, "> $basefname"); + open(FD, "> $basefname") or die "cannot open $basefname\n"; $cont = gunzip($filename.".tmp"); print FD $cont; close(FD); -- 2.39.2