summaryrefslogtreecommitdiff
path: root/SL2LS.pl
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-06 03:04:34 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-06 03:04:34 +0000
commit6bbd302a4024e25030b3835bc7fe435e48b3f1a9 (patch)
tree46d4015634f9bc2161d2a697d1de44972f9b7c58 /SL2LS.pl
parent5e0942c40e9f18d6b0496afcc00939b71af967a6 (diff)
Completed a basic SL2LS.pl
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@30 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'SL2LS.pl')
-rwxr-xr-xSL2LS.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/SL2LS.pl b/SL2LS.pl
index 4824d2c6..50b1e098 100755
--- a/SL2LS.pl
+++ b/SL2LS.pl
@@ -10,6 +10,28 @@ while ($line = <SL>){
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;
+}