-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inotify: watch the directory not just file
Editors (such as vim, nano ..) follow different approaches to save conf file. The two commonly followed techniques are to overwrite the existing file, or to write to a new file (.swp, .tmp ..) and move it to actual file name later. In the later case, the inotify fails, because the file it's been intended to watch no longer exists, as the new file is a different file with just a same name. To handle both the file save approaches mentioned above, it is better we watch the directory and filter for MODIFY events. Signed-off-by: Xiubo Li <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters