#! /usr/bin/perl -w

$debug=0;
$dir="/usr/local/fontine/var";
$ttf="ttf";
$font1="HGRHR4.TTF";
$font2="HGRHG5.TTF";
$font3="HGRHR8.TTF";

print $dir."\n" if $debug;

chdir($dir);
@files=glob("*");
foreach $file (@files) {
  if (-d $file && $file eq $ttf) {
    chdir($ttf);
    @files2=glob("*");
    foreach $file2 (@files2) {
      if (-f $file2 &&
        ($file2 eq $font1) ||
        ($file2 eq $font2) ||
        ($file2 eq $font3)) {
        #nop
      }
      else {
        $com1="rm -rf $file2";
        print $com1."\n" if $debug;
        system($com1);
      }
    }
    chdir("..");
  }
  else {
    $com2="rm -rf $file";
    print $com2."\n" if $debug;
    system($com2);
  }
}

$file_1="/usr/local/sony/lib/sj3/dict/user/root/private.dic";
$file_2="/usr/local/sony/lib/sj3/dict/user/root/study.dat";

print $file_1."\n" if $debug;
print $file_2."\n" if $debug;

if (-f $file_1) {
  $com3="rm -rf $file_1";
  system($com3); 
}
if (-f $file_2) {
  $com4="rm -rf $file_2";
  system($com4); 
}
