Ever wonder what happens when you save a file in vim? There's quite a lot more
happening than open
, write
, and close
. I found this out while working on
some code to monitor changed files using the node.js fs.watch
API, which abstracts
(or obscures) Mac OS X's kqueue API.
To find out exactly what vim
is doing when saving a file, we'll use a tool
included with DTrace that reports on another process's system calls. We need
the process ID of vim, which is already open and editing my file: