Check if file is finished copying when using watchdog

Viewed 264

I'm using watchdog to watch a folder for new files.

When I copy a file to the watched directory, the watchdog triggers 4 times.

  • FileCreatedEvent - when the copy initiates
  • DirModifiedEvent - at the same time as FileCreatedEvent
  • FileModifiedEvent - when the transfer begins
  • FileModifiedEvent - when the transfer finishes

Is there a way to tell when the transfer has finished so it only works on files that are finished copying and doesn't attempt to process an incomplete file?

0 Answers
Related