:

DIR="help models include  "

OLD_EXE="mkUsrDir  nCompil ld_n launch__n_calchep make__n_calchep"
OLD_RD="calchep calchep.ini icon  axodraw.sty  cteq5m.pdf"  
NEW_EXE="s_calchep tab_view  mk_tab"
NEW_RD="CC  num_c.a  serv.a  usrlib.a  n_calchep.o "



errcode=0

for FILE in $DIR 
do
 if(test ! -d $FILE) then 
   echo Subdirectory $FILE is absent
   errcode=1
 fi
   
 chmod 755 $FILE
 chmod 644 $FILE/*.* 
done

for FILE in $OLD_RD
do
  if(test ! -s $FILE) then 
    echo File $FILE is absent
    errcode=1
  fi
  chmod 644 $FILE
done

for FILE in $OLD_EXE
do
  if(test ! -s $FILE) then 
    echo File $FILE is absent
    errcode=1
  fi
  chmod 755 $FILE
done


for FILE in $NEW_RD
do
  if(test ! -s $FILE) then 
    echo File $FILE is not created
    errcode=1
  fi
  chmod 644 $FILE
done

for FILE in $NEW_EXE
do
  if(test ! -s $FILE) then 
    echo File $FILE is not created
    errcode=1
  fi
  chmod 755 $FILE
done

if (test $errcode -eq 0) then 
  echo All needed files exist and have an appropriate mode.
fi
