taken
06-22-2009, 10:40 AM
1. Is this the correct way (efficiency) to do this? (on WinXP box, local server, PHP command line) (no, I can't use the win32 ports of wget, curl, etc)
2. 8192 (8Kb) is OK? what about a larger 1MB buffer?
3. Download speed is not a problem, but these scripts should work 24x7 for 2 or 3 days. Is this bad for the 1TB WD hard disk? fwrite=automatic buffering (by WinXP)?
//$url1="http://remote-server/3GB-remote-file.binary";
$handler = get_handler($url1);
if (!$g = fopen($local_file, 'a'))
{
exit;
}
while ($buffer = fread($handler, 8192))
{
fwrite($g, $buffer);
}
fclose($g);
2. 8192 (8Kb) is OK? what about a larger 1MB buffer?
3. Download speed is not a problem, but these scripts should work 24x7 for 2 or 3 days. Is this bad for the 1TB WD hard disk? fwrite=automatic buffering (by WinXP)?
//$url1="http://remote-server/3GB-remote-file.binary";
$handler = get_handler($url1);
if (!$g = fopen($local_file, 'a'))
{
exit;
}
while ($buffer = fread($handler, 8192))
{
fwrite($g, $buffer);
}
fclose($g);
