title: How can I detect if a file has been modified using lastModified()
body: <p>I know I can use lastModified() to get the last modified time of a file. What I don't understand is that how can I use this method to detect if a file has been changed or not. Do I compare it with the current time?
  I was trying to do the following but I don't think it works</p>
  
  <pre><code>long time = xx.lastModified();
  if(time != localtime)
  //.....
  </code></pre>