- my $command="huffbuild $datafile $arg";
- print ">>> $command\n";
- die "Couldn't build huffbook.\n\tcommand:$command\n"
- if syst($command);
+ # check the desired subdir to see if the data file exists
+ if(-e $datafile){
+ my $command="cp $datafile $bookname.tmp";
+ print ">>> $command\n";
+ die "Couldn't access partition data file.\n\tcommand:$command\n"
+ if syst($command);
+
+ my $command="huffbuild $bookname.tmp $interval";
+ print ">>> $command\n";
+ die "Couldn't build huffbook.\n\tcommand:$command\n"
+ if syst($command);
+
+ my $command="rm $bookname.tmp";
+ print ">>> $command\n";
+ die "Couldn't remove temporary file.\n\tcommand:$command\n"
+ if syst($command);
+ }else{
+ my $command="huffbuild $bookname.tmp 0-$range";
+ print ">>> $command\n";
+ die "Couldn't build huffbook.\n\tcommand:$command\n"
+ if syst($command);
+
+ }