#!/usr/local/bin/perl -w
#
$sourcedir = $ARGV[2];
$sourcefile = $ARGV[0];
$dirfoilset = $ARGV[1];
$trypptdir = "$sourcedir/$sourcefile";
#
$basedir= `pwd`;
chomp($basedir);
print "Creating Directory ",$dirfoilset,"\n";
#
unless( -e $trypptdir )	{
	die "Nonexistent Source Data $trypptdir\n"; }
#
$com = "/project/gcf_proj/foils/remoteprogs/runoriginalppt $sourcefile $dirfoilset $sourcedir";
system($com);
chdir($basedir);
#
&doextra();
exit;
#
sub doextra	{
#
	$extra = "${dirfoilset}/extrainfo";
	return if(-e $extra);
	unless(-e $trypptdir)   {
                print "No powerpoint HTML export file $trypptdir\n";
                return;
        }
	open(EXTRA,'>'. $extra) || die("\nSorry couldnt Open $extra \n");
        print EXTRA "sourcepptdir:$trypptdir\n";
        close(EXTRA);
	return;
}
