title: Why fs.watchFile called twice in Node?
body: <p><code>Ubuntu 12.04</code> <code>Node v0.6.14</code> <code>CoffeeScript 1.3.1</code>  </p>
  
  <pre><code>fs.watchFile coffee_eval, (e) -&gt;
    console.log e
    result = spawn 'coffee', ['-bc', coffee_eval]
    msg = ''
    result.stderr.on 'data', (str) -&gt;
      msg+= str
    result.stderr.on 'end', -&gt;
      console.log 'msg: ', msg
    print "!! #{coffee_eval}\n"
  </code></pre>
  
  <p>Whole code on gist: <a href="https://gist.github.com/2621576" rel="nofollow noreferrer">https://gist.github.com/2621576</a> </p>
  
  <p>Every time I save a file which is watched, the main function is called twitce rather than once.<br>
  My Editor is Sumlime Text 2.</p>
  
  <p>the output words can be see :<br>
  <img src="https://i.stack.imgur.com/PxMg0.png" alt="enter image description here"></p>