Well I couldn't output the connection_status() result to a file, buuuuuut I modded the code to
<?php
// Running on a Windows XP machine with an Apache server
error_reporting(E_ALL);
ignore_user_abort(false); // Does indeed affect behavior now
function cleanup($filename){
switch(connection_status()){
case 1:
unlink($filename);
case 2:
case 3:
break;
}
}
$filename = tempnam(getcwd(), 'tmp');
register_shutdown_function('cleanup', $filename);
set_time_limit(5);
// Purposely causes a CONNECTION_TIMEOUT
do{
echo 'foo';
}while(true);
?> This unlinks the file if a CONNECTION_ABORT happens, but does not unlink the file if a CONNECTION_TIMEOUT or a CONNECTION_TIMEOUT & CONNECTION_ABORT happen simultaneously. Thanks a lot for the help Sane. It seems you were onto something about the browser output thing. My previous code was in fact deleting the file but I guess it deleted it after the machine returned from sleep().