xiaozi 2014-12-10 23:35:09

fopen以append模式打开文件时,fwrite本身就是原子操作(除非string大于系统的block size,一般为4k),不需要使用flock

php php
<?php

$fd = fopen('test.txt', 'a+');
// flock($fd);
fwrite($fd, '测试内容');
fclose($fd);

评论

trang chủ - Wiki
Copyright © 2011-2025 iteam. Current version is 2.142.1. UTC+08:00, 2025-04-05 07:42
浙ICP备14020137号-1 $bản đồ khách truy cập$