You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
15
vendor/swoole/examples/mmap/mmap.php
vendored
Executable file
15
vendor/swoole/examples/mmap/mmap.php
vendored
Executable file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$file = '/tmp/data';
|
||||
$size = 8192;
|
||||
|
||||
if (!is_file($file)) {
|
||||
file_put_contents($file, str_repeat("\0", $size));
|
||||
}
|
||||
|
||||
$fp = swoole\mmap::open($file, 8192);
|
||||
|
||||
fwrite($fp, "hello world\n");
|
||||
fwrite($fp, "hello swoole\n");
|
||||
|
||||
fflush($fp);
|
||||
fclose($fp);
|
Reference in New Issue
Block a user