ext-uv/examples/fsw.php

18 lines
384 B
PHP
Raw Normal View History

2012-06-22 05:51:16 +02:00
<?php
2012-06-22 16:01:32 +02:00
uv_fs_open(uv_default_loop(),"./tmp", UV::O_WRONLY | UV::O_CREAT | UV::O_APPEND,
UV::S_IRWXU | UV::S_IRUSR,
function($r){
2012-06-22 05:51:16 +02:00
var_dump($r);
2012-06-22 17:59:27 +02:00
uv_fs_write(uv_default_loop(),$r,"hello",function($a) use ($r){
2012-06-22 05:51:16 +02:00
var_dump($a);
var_dump("ok");
2012-06-22 17:59:27 +02:00
uv_fs_fsync(uv_default_loop(),$r,function(){
echo "fsync finished";
});
2012-06-22 05:51:16 +02:00
});
});
uv_run();