-
Notifications
You must be signed in to change notification settings - Fork 376
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
FAQ ambiguity for IN_CLOSE_WRITE #55
Comments
Hi Alex, Which FAQ are you referring to?, I can't find where I wrote this. Anyway, to answer your point, the inotify manpage only states:
I believe that this event only provides the information that the corresponding file descriptor was closed, I don't think it provides any guarantee on the integrity/completion of written data on disk, there are certainly system buffers that may or may not have been flushed at the moment the file was closed. I hope it helps, |
Thank you for the ultra-fast reaction. Here's the page where I found that: Hmmm... so this is a generic behaviour side-effect of inotify and not something specific to pyinotify. In case someone else is wondering how this worked out, here's a StackOverflow discussion about it: |
As I said previously I think that the mission of inotify (and therefore as reported by Pyinotify) is to signal you when a file is closed (more precisely when it is closed by its file descriptor), but obviously the kernel uses buffers and so the file data may not be written on disk immediately. For more details see the man (2) of the
Bottom line you can not rely on |
There is a tricky part in the FAQ that leaves room for interpretation:
Does it mean
It seems to be the former, but I am experiencing a situation in which IN_CLOSE_WRITE is triggered, but when I open the file - it doesn't contain any changes yet. So I thought I would first make sure that I understand the manual correctly.
The text was updated successfully, but these errors were encountered: