Fix to show error when file can't be open

This commit is contained in:
Laurent Destailleur 2020-11-26 17:00:49 +01:00
parent 42d88b6e62
commit fab4fcf1d6

View File

@ -125,6 +125,11 @@ $checksumconcat=array();
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
$fp = fopen($outputfile, 'w');
if (empty($fp)) {
print 'Failed to open file '.$outputfile."\n";
exit(-1);
}
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");