remove directories also
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 30 Jan 2006 15:16:45 +0000 (15:16 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 30 Jan 2006 15:16:45 +0000 (15:16 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@321 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_burnArchiveCLI

index 90bd03b..d149834 100755 (executable)
@@ -278,8 +278,13 @@ sub delete_dvd($) {
 
                # remove files for this DVD
                map {
-                       print "\tremoving $_\n";
-                       unlink($_) || die "can't rm $_: $!";
+                       if (-d $_) {
+                               print "\tremoving dir $_\n";
+                               rmtree($_) || die "can't rmtree $_: $!";
+                       } else {
+                               print "\tremoving $_\n";
+                               unlink($_) || die "can't rm $_: $!";
+                       }
                } glob ( "/$iso_dir/$dvd_nr.*" );
 
                $dbh->commit;