title: How to watch symlink'ed files in node.js using watchFile()
body: <p>I am trying to monitor a file that is (soft) symlink'ed with node.js' watchFile() with the following code:</p>
  
  <pre><code>var fs=require('fs')
      , file= './somesymlink'
      , config= {persist:true, interval:1}; 
  
  fs.watchFile(file, config, function(curr, prev) { 
      if((curr.mtime+'')!=(prev.mtime+'')) { 
          console.log( file+' changed'); 
      } 
  });
  </code></pre>
  
  <p>In the above code, <strong>./somesymlink</strong> is a (soft) symlink to <strong>/path/to/the/actual/file</strong>.
  When changes are made to the /path/to/the/actual/file, no event is fired. I have to replace the symlink with /path/to/the/actual/file to make it work. It seems to me that watchFile is not able to watch symlink'ed files. Of course I could make this work by using spawn+tail method but I prefer not to use that path as it would introduce more overhead.</p>
  
  <p>So my question is how can I watch symlink'ed files in node.js using watchFile(). Thanks folks in advance.</p>