-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscribe to IN_MODIFY events for Inotify #81
Comments
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). I don't understand how it doesn't work for you, i think that i need a better explanation on how your software works, the 30 seconds delay sounds fine, but, it should wait since Add to Modified ( sine modified event is emitted after the file descriptor close call ), and then, you should wait 30 seconds. Case 1: It's correct, and should be enough for you. Just detect the new files ( Add ), and wait to the Modified event, then you can upload it to the cloud. Case 2: Just let me know if i understood correctly. |
Original comment by Mihail Slobodyanuk (Bitbucket: mihail_slobodyanuk, ). Just tried modified case 2. It seems case above sometimes generated Add then Delete but sometimes only Moved. The changes is: mv /1/file /2 where watch established only on /2 folder. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Oh, you're right in that case, i should emit also a Modified after the Add to fulfill your requirements. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Added the modified event for that case: |
Original comment by Mihail Slobodyanuk (Bitbucket: mihail_slobodyanuk, ).
It seems i don't need to handle 'Add' action? Looks like 'Modify', 'Move' and 'Delete' is enough. Also just FUI. File modify operation can be in 'long open' mode like:
and in 'short open'
Both cases are same for end user side and should be handled in same at the end |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). No, they are not the same. The echo is opening, writing and closing the file, that's why you get constants modified, because the file is being opened and closed every time. A normal file copy NEVER closes the file on every write. I still don't see the point to add IN_MODIFIED event report, but you are free to fork the library :) May be this can be added as an optional parameter, but i prefer to keep the library as clean as possible. I will take a look on how it's reported this case in Windows and OS X, because i don't remember, for the moment i won't make any change. Regards! |
Original comment by Mihail Slobodyanuk (Bitbucket: mihail_slobodyanuk, ). Agree. It's not the same on system level. But 3rdparty programs can implement both cases. And I need take into account both. I am don't press you to add IN_MODIFIED. The more I do not know a similar behavior on Windows and wanted discuss with you is current behavour is enough. It seems yes. Thank you! |
Original report by Mihail Slobodyanuk (Bitbucket: mihail_slobodyanuk, ).
Maybe i have implemented wrong usecase of EFSW but i found following issue:
I use EFSW to detect FS changes then waiting for finishing changes then transfer changes to cloud storage. I am process files only after "sanitize" delay after last modify event (30 sec) to ensure file changes was finished.
But i found EFSW not subscribed to IN_MODIFY event (FileWatcherInotify.cpp:128).
And i have less info about changes.
Case 1)
The command:
dd if=/dev/urandom bs=1M count=1500 of=file
issue two events: 'Add' on start and file creatin then 'Modified' after file closed. If command execution time > 30 sec then my code will take file into accouns as finished.
Ok. Maybe i don't need to handle 'Add' but
Case 2)
Renaming file:
mv file1 file2
Issued 'Delete' for file1 then 'Add' for file2 and no more.
Looks like IN_MODIFY is required?
The text was updated successfully, but these errors were encountered: