dongle2627 2019-06-20 09:16
浏览 158
已采纳

防止多个用户同时写入文件[重复]

This question is an exact duplicate of:

I've done a php page index.php which uses some python scripts to retrieve some informations and copy them from a file A to a file B. My problem is that if I have more than one user that access index.php, B is modified from both the users. How can I make the second user wait until the first user has finished to modify B?

</div>
  • 写回答

2条回答 默认 最新

  • dongzhang7961 2019-06-20 11:13
    关注

    You can make one file in parallel xyz.txt.in_use and check for it every time from other location that the file is exists OR not then wait till it got deleted then after the writing completion, delete the xyz.txt.in_use, so that other can take charge on xyz.txt

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 两个不同Subnet的点对点连接
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)
  • ¥66 比特币地址如何生成taproot地址