java - How to make inotify wait when processing multiple files -
I am working on a directory sync program which uses jnotify to check for changes.
This is the idea that whenever the jannat detects any change, one is synced. The problem is that when many files are copied or modified in a directory, many syncing is done instead of a large sync.
Ideally if you copy 100 large files of the directory, Sync B will not come in the directory until all the files are completely copied to Directory A.
I have somehow thought to capture files using a temporary directory (A1) until they copy completely and then move them to A1. But this solution does not work well because I am using Unity to sync which only sends the file Delta - and it is a feature I would not like to use or would like to use it.
Perhaps one way of using it is to detect I / jnotify when multiple files are being updated at one time?
Here is a suggestion about setting up a set on your application and making it "modified" files To gather / remove it, that file will be added to a set and when the number of files exceeds a certain number, then say 100, then you will sync. It would also be a good idea to set a timer if you want it to be responsive, like there is no new change, which is being added to the set for X, go ahead of time and even make a sync.
Comments
Post a Comment