atomically creating a file lock in MATLAB (file mutex)

后端 未结 5 784
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 18:24

I am looking for a simple already implemented solution for atomically creating a file lock in MATLAB.

Something like:

file_lock(\'create\', \'mylockf         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-18 19:05

    Write to a new file, then rename it. Renaming is an atomic operation, and all the new content will become visible at once.

提交回复
热议问题