From 6bbd302a4024e25030b3835bc7fe435e48b3f1a9 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 6 Sep 2006 03:04:34 +0000 Subject: Completed a basic SL2LS.pl git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@30 4979c152-3d1c-0410-bac9-87ea11338e46 --- SL2LS.pl | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'SL2LS.pl') diff --git a/SL2LS.pl b/SL2LS.pl index 4824d2c6..50b1e098 100755 --- a/SL2LS.pl +++ b/SL2LS.pl @@ -10,6 +10,28 @@ while ($line = ){ print LS $line; } -unlink sql-ledger.conf; +unlink "sql-ledger.conf"; +unlink "setup.pl"; #TODO: Move/Delete the SL directory + +&recursive_unlink("SL"); + +sub recursive_unlink { + ($dir) = shift @_; + print "Recursively deleting $dir\n"; + opendir (DIR, $dir); + while ($file = readdir DIR){ + if ($file !~ /^\.+$/){ + $file = "$dir/$file"; + if (-f $file){ + unlink $file; + } elsif (-d $file){ + &recursive_unlink("$file"); + } + } + } + closedir(DIR); + print "Removing $dir\n"; + rmdir $dir; +} -- cgit v1.2.3