Atomic file write operations (cross platform)

后端 未结 7 1808
礼貌的吻别
礼貌的吻别 2020-12-28 15:34

How do I build up an atomic file write operation? The file is to be written by a Java service and read by python scripts.
For the record, reads are far greater than writ

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 15:46

    It's a classic producer/consumer problem. You should be able to solve this by using file renaming, which is atomic on POSIX systems.

提交回复
热议问题