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(<FD>) { $cont .= $_; }
close(FD);
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(<FD>) { $cont .= $_; }
close(FD);
} else { # error
# <gzip>
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);
$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);