Using pyinotify to watch for file creation, but waiting for it to be completely written to disk

后端 未结 3 720
忘掉有多难
忘掉有多难 2021-01-02 16:44

I\'m using pyinotify to watch a folder for when files are created in it. And when certain files are created I want to move them. The problem is that as soon as the file is c

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-02 17:43

    If you have control of the writing process, you could call the file "foo.part" while it is being written to and rename it to "foo" when it has been closed.

提交回复
热议问题