Для получения полного доступа
зарегистрируйтесь.

tetraset    6   5,673


It seems user decided to remain silent about himself.
  • Registered 4 years ago
Профиль завершён на 0 %
0 %
function chunkedCopy($from, $to) {
    # 1 meg at a time, you can adjust this.
    $buffer_size = 1048576;
    $ret = 0;
    $fin = fopen($from, "rb");
    $fout = fopen($to, "w");
    while(!feof($fin)) {
    	$ret += fwrite($fout, fread($fin, $buffer_size));
    }
    fclose($fin);
    fclose($fout);
    return $ret;
}