xref: /php-uv/examples/fsw.php (revision 99312394)
1<?php
2
3uv_fs_open(uv_default_loop(), "./tmp", UV::O_WRONLY | UV::O_CREAT | UV::O_APPEND,
4    UV::S_IRWXU | UV::S_IRUSR,
5    function($fd) {
6        var_dump($fd);
7        uv_fs_write(uv_default_loop(), $fd, "hello", 0, function($fd, $result) {
8            var_dump($result);
9            var_dump("ok");
10            uv_fs_fdatasync(uv_default_loop(), $fd, function(){
11               echo "fsync finished";
12            });
13        });
14    }
15);
16
17
18uv_run();
19