How can I simulate a “locked” file (one which has a write lock)

前端 未结 4 1294
[愿得一人]
[愿得一人] 2021-02-05 09:37

I am trying to debug a problem where users occasionally have locked files which they try to open. The code appears to have correct exception handling but users are still report

4条回答
  •  难免孤独
    2021-02-05 10:03

    try this:

    ( >&2 pause ) >> yourfile.txt
    

    >> opens yourfile.txt in append mode

    see this for a reference

提交回复
热议问题