2012-06-22 01:20:22 +02:00
|
|
|
<?php
|
2012-07-03 01:20:50 +02:00
|
|
|
uv_fs_open(uv_default_loop(),__FILE__, UV::O_RDONLY, 0, function($r){
|
2020-02-15 22:36:03 +01:00
|
|
|
uv_fs_read(uv_default_loop(),$r,function($stream, $data) {
|
|
|
|
if (is_long($data)) {
|
2012-07-03 01:20:50 +02:00
|
|
|
if ($nread < 0) {
|
|
|
|
throw new Exception("read error");
|
|
|
|
}
|
2012-06-22 01:20:22 +02:00
|
|
|
|
2012-07-03 01:20:50 +02:00
|
|
|
uv_fs_close(uv_default_loop(), $stream, function(){
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
echo $data;
|
2012-06-22 16:01:32 +02:00
|
|
|
}
|
2012-07-03 01:20:50 +02:00
|
|
|
});
|
2012-06-22 01:20:22 +02:00
|
|
|
});
|
|
|
|
|
2012-07-03 01:20:50 +02:00
|
|
|
uv_run();
|