Copying and Deleting

Windows

xcopy <source> <destination> /E /I /C /Y /F
rmdir <dir> /S /Q

Linux

cp -Rv <source> <destination>
rm -fr <dir>

Now I can perform

<?php
if(stristr( PHP_OS, 'WIN' ))
{
  $arg = 'xcopy '. $source .' '. $destination .' /E /I /C /Y /F 1>'. $outfile .' 2>'. $errfile;
  exec ( $arg, $out, $ret );
}
 
if(stristr( PHP_OS, 'Linux' ))
{
  $arg = 'cp -Rv '. $source .' '. $destination .' 1> '. $outfile .' 2> '. $errfile;
  exec ( $arg, $out, $ret );
}
?>

About this entry