开发者

how to get file contents of locked file in PHP

What's the best way, idiomatically, of getting the file contents (into a string) of a flock'd file in PHP?

Edit: To be clear, this is something 开发者_StackOverflow中文版locked by the current page/process. Something like:

if(flock($fp ...)) {
  $str = READFILECONTENTS($fp);
  flock(...);
}


Don't. Wait for the lock to be released and only then read it.

Or just read it anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜