ext-uv/examples/fs.php
Shuhei Tanuma 64deffda15 WIP: uv_fs
2012-06-22 08:20:22 +09:00

23 lines
360 B
PHP

<?php
function r($rs,$data)
{
global $buf;
global $x;
$buf .= $data;
if ($rs != 0) {
echo "moe";
uv_fs_read(uv_default_loop(),$x,"r");
} else {
var_dump($buf);
}
}
uv_fs_open(uv_default_loop(),"./fs.php", 0, 0, function($r){
global $x;
$x = $r;
uv_fs_read(uv_default_loop(),$r,"r");
});
uv_run();