From 46a7038a1e2c611a34edaf2b5802216563968fb1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 3 Apr 2020 21:51:45 +0200 Subject: mirror.php: delete 0-length files *before* handing them out --- mirror.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mirror.php b/mirror.php index 55f18e8..82fd4ae 100644 --- a/mirror.php +++ b/mirror.php @@ -66,6 +66,12 @@ fwrite($al,date('Y-m-d H:i:s')." ".$pfad."\n"); fclose($al); + if (file_exists($pfad)) { + $stat = stat($pfad); + if ($stat['size'] == 0) + unlink($pfad); + } + if (! file_exists($pfad)) { passthru( "mkdir -p '".dirname($pfad)."'; ". -- cgit v1.2.3-70-g09d2