From 4241cbec3c0fec927a617cfc66968ada55b25763 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Fri, 14 Jan 2005 05:38:41 +0000 Subject: [PATCH] Add a script for alisadb. --- kagedb/getaliastxt.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 kagedb/getaliastxt.pl diff --git a/kagedb/getaliastxt.pl b/kagedb/getaliastxt.pl new file mode 100755 index 0000000..1248410 --- /dev/null +++ b/kagedb/getaliastxt.pl @@ -0,0 +1,26 @@ +############################################################################### +# getaliastxt.pl +# +# create txt file from KAGE/cgi +# by Koichi Kamichi +############################################################################### + +if($#ARGV != 0 || !(-d $ARGV[0])){ + print "Usage: perl getaliastxt.pl aliasdb_dir\n"; + exit; +} +$aliasdir = $ARGV[0]; +$aliasdir =~ s/\/?$//; # remove the last slash + +use Fcntl; +use BerkeleyDB; + +tie %db, "BerkeleyDB::Hash", -Filename => "$aliasdir/aliasdb", -Flags => DB_RDONLY +or die "An error occured at opening DB file.\n"; +%db = (); + +foreach(sort(keys(%db))){ + print "$_\t$db{$_}\n"; +} + +untie(%db); -- 1.7.10.4