PHP Code:
public bool:copy_file( const szSourceFile[] , const szDestFile[] )
{
new iSource , iDest , iBytesRead , bytBuffer[ 1024 ];
if ( ( iSource = fopen( szSourceFile , "rb" ) ) && ( iDest = fopen( szDestFile , "wb" ) ) )
{
while ( ( iBytesRead = fread_blocks( iSource , bytBuffer , sizeof( bytBuffer ) , BLOCK_BYTE ) ) )
{
fwrite_blocks( iDest , bytBuffer , iBytesRead , BLOCK_BYTE );
}
fclose( iSource );
fclose( iDest );
}
return bool:( iSource && iDest );
}
__________________