Hi i implemented a java file watcher which reads the file when it is created.
It works fine on development machine. I created a few files and through the logs, the ENTRY_CREATE is called and my program reads the files as expected. The ENTRY_MODIFY is not called.
But on a production machine it behaves differently. Many files are written to the directory, and my program failed to read the files properly when the ENTRY_CREATE is called. I noticed there were a few ENTRY_MODIFY.
How do I tell if the file is completed so my program can read the file properly. From this article, it mentioned that the file is done when the last modified is called. But how do i know? And sometimes ENTRY_MODIFY is not called.