copi file sourc destin todo belong util sort param sourc sourc file copi param dest destin file success statu flag copi file file sourc file dest file input stream fi file input stream sourc file output stream fo file output stream dest buf fi read buf fo write buf fi close fo close file except defin log lp log granular type statement log error file copi endif io except defin log lp log granular type statement log error io error copi file endif secur except defin log lp log granular type statement log error allow copi file endif 