#! /usr/bin/perl

# mkduck -- creates a new DB folder
#
# Author: Steve Brewer
# Last modified: 2/8/2000
#
# uncomment to make it need to run as root
#if ($>) { die "Must be run as root\n"; }

# set the directory to work in
$dir = "/usr/local/apache/share/htdocs/general";


$new = "$dir/$ARGV[0]";
$xxx = "$dir/template";
die "Usage: mkdb -af <topic>\n" if (!$ARGV[0]);
#make a directory, if necessary
if (!( -d $new )) {
  system("mkdir $new")
}
# copy files 
# this is the magic tar command
system("cd $xxx ; /bin/tar cf - . | (cd $new ; /bin/tar xfBp -)");

$i=1;
while($i<6) {
  system ("touch $new/instructor/data/data.$i");
  $i++;
}

exit;

