-
Notifications
You must be signed in to change notification settings - Fork 487
Analysis of inotify events for different editors
This page collects information about the fired inotify events that different Linux editors fires on file modification. The events are collected using inotifywait.
Steps to add an event analysis of your editor:
- Open the file
- Launch
inotifywait -m .
in the directory containing the file - Change the file content
- Save the file
- Quit inotifywait
IMPORTANT NOTE: Remember to watch the directory containing the file, not the file itself!
Manual and auto-save events are currently indistinguishable
To disable RubyMine's auto-save/synchronization feature: File > Settings > General
total attrib delete_self filename
3 1 1 coffee/script.coffee
total modify close_write open filename
5 3 1 1 coffee/script.coffee
Given a file coffee/script.coffee and watching the coffee dir:
% inotifywait -m coffee
Setting up watches.
Watches established.
./ CREATE .sublc0f.tmp
./ OPEN .sublc0f.tmp
./ ATTRIB .sublc0f.tmp
./ MODIFY .sublc0f.tmp
./ CLOSE_WRITE,CLOSE .sublc0f.tmp
./ ATTRIB .sublc0f.tmp
./ MOVED_FROM .sublc0f.tmp
./ MOVED_TO script.coffee
Note how there's only 1 event on the file guard watches: MOVED_TO.
(This is because Sublime calls rename() without deleting the file, which makes Guard think it's a new file, which calls the run_on_additions plugin method - a method many guard plugins don't implement).
Details:
-
Kate creates a backup file, e.g.
foo.rb
->foo.rb~
(suffix is configurable) -
Kate uses QTemporaryFile with a template "XXXXXX.new", which means e.g.
foo.rb
->foo.rbo53241.new
(see: qtemporaryfile.cpp) -
Kate uses "overwrite" technique to allow saving file in read-only directories:
foo.rbo53241.new
->foo.rb
(no delete happens)
E.g.:
[:delete]: users_controller_spec.rb~
[:moved_to, :move]: users_controller_spec.rb~
[:attrib]: users_controller_spec.rb~
[:create]: users_controller_spec.rbo22583.new
[:attrib]: users_controller_spec.rbo22583.new
[:close_write, :close]: users_controller_spec.rbo22583.new
[:close_write, :close]: users_controller_spec.rbo22583.new
[:moved_from, :move]: users_controller_spec.rbo22583.new
[:moved_to, :move]: users_controller_spec.rb
total attrib move_self delete_self filename
4 1 1 1 coffee/script.coffee
Details: The events Vim generates during saving actually depends on options, e.g. backup/backupdir/patchmode/backupcopy/writebackup/backupskip
total access attrib close_write close_nowrite open delete_self filename
8 1 1 1 1 2 1 coffee/script.coffee
total modify close_write open filename
5 3 1 1 coffee/script.coffee
total access modify attrib close_write close_nowrite open filename
10 1 4 1 1 1 2 coffee/script.coffee
total move_self filename
1 1 coffee/script.coffee
total modify close_write open filename
5 3 1 1 coffee/script.coffee
total attrib close_write open filename
4 2 1 1 coffee/script.coffee
total modify close_write open filename
4 2 1 1 coffee/test.txt
total modify close_write open filename
4 2 1 1 coffee/script.coffee
total access modify close_write close_nowrite open filename
9 1 2 1 2 3 my/fine/file
Sed uses the "overwrite with move" trick.
from running: `sed -e 's/a/b/' -i index.html`
./ OPEN index.html
./ CREATE sedBF20nx
./ OPEN sedBF20nx
./ MODIFY sedBF20nx
./ MODIFY sedBF20nx
./ MODIFY sedBF20nx
./ MODIFY sedBF20nx
./ ATTRIB sedBF20nx
./ ATTRIB sedBF20nx
./ CLOSE_NOWRITE,CLOSE index.html
./ CLOSE_WRITE,CLOSE sedBF20nx
./ MOVED_FROM sedBF20nx
./ MOVED_TO index.html
This wiki and the Guard README document contain a lot of information, please take your time and read these instructions carefully.
If you run into any trouble, you may start by understanding how Guard works.
We provide detailed changes for each Guard release.
Be sure to read the CONTRIBUTING guidelines before reporting a new Guard issue or open a pull request.
If you have any questions about the Guard usage or want to share some information with the Guard community, please go to one of the following places:
- Google+ community
- Google group
- StackOverflow
- IRC channel
#guard
(irc.freenode.net) for chatting