inotify: Difference between revisions

From vegard.wiki
Jump to navigation Jump to search
Content added Content deleted
(new page)
 
No edit summary
 
Line 1: Line 1:
Remember:
Remember:
* programs like vim write out a modified file to a new file and then rename it to give it the new name, so there is never any open or close event for the edited file itself, just a move and a delete event
* programs like vim write out a modified file to a new file and then rename it to give it the new name, so there is never any open or close event for the edited file itself, just a move and a delete event
* deleting a file causes the watch to be removed with a separate <tt>IN_IGNORED</tt> event after the <tt>IN_DELETE_SELF</tt> event


Tips:
Tips:

Latest revision as of 21:00, 23 December 2019

Remember:

  • programs like vim write out a modified file to a new file and then rename it to give it the new name, so there is never any open or close event for the edited file itself, just a move and a delete event
  • deleting a file causes the watch to be removed with a separate IN_IGNORED event after the IN_DELETE_SELF event

Tips:

  • Use inotifywait -m foo.txt to show what events are generated when accessing the filesystem in particular ways.