-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
inotifywait shows different number of MODIFY events on the same writing operation #116
Comments
maybe it's due to the file is not opened by |
I'll tell you what I'm seeing OS: xubuntu 20.04
and the corresponding strace:
this all looks ok on my machine. Could you try the latest version of the code @meow-watermelon ? I recommend putting strace watching the whole while loop just to be sure you are catching everything. Then we can start chasing things like kernel version, filesystem type, etc. Often a good way to start is write a test in here: https://github.com/inotify-tools/inotify-tools/tree/master/t that detects this difference, so you can quickly identify on which platforms this difference occurs. |
Hi @ericcurtin, thanks for your reply. But I think what I did is kinda different than what you did. I'm using The strace output:
inotifywait output:
So once I'm using bash -c to call the echo this will show the same number of MODIFY events. But I still have a question here, why there are 7 modify events? But there are 6 Thanks. |
Yeah I used printf over echo -e just to use another similar tool to see if it changed the write behavior. What's interesting is when I use echo -e on my machine it is one single write when redirected to file:
But yours is getting chunked into several writes, which is fine, possibly just a platform difference, maybe they changed the behaviour of The openat is being treated as a modify event it seems. I'll have to maybe take a peak at some Linux kernel code and this code to see if this is what we want or expect, if the answer is yes, maybe an update in documentation is all that's required here. |
Hi @ericcurtin, The shell is bash and the version is 4.4.23. Thanks. Hui |
But what I think is a good idea, is maybe to start writing tests for each C call. I'll write one for |
We are clearing up our old issues and your ticket has been open for 2 years with no activity. Remove stale label or comment or this will be closed in 30 days. |
When calling |
Describe the bug
I noticed the inotifywait reports different number of MODIFY events when writing to the same file.
To Reproduce
Steps to reproduce the behavior:
Open one terminal and run:
Open another terminal and run:
Expected behavior
I should expect I can see the same number of MODIFY events in each cycle.
Screenshots
OS: Fedora 31
Kernel Version: 5.6.18-200.fc31.x86_64
Package Version: inotify-tools-3.14-18.fc31.x86_64
Thanks.
The text was updated successfully, but these errors were encountered: