title: Changing a File's content does not change the file lastModified
body: <p>I am writing a simple test to change a <code>File</code>'s content. As you can see the printed content is what's expected. But the <code>lastModified()</code> descriptor is not modified. Eventually, what I'm just trying to get to is a <code>Boolean</code> field representing whether or not my file has changed. </p>
  
  <p>I need to make my thread sleep for 1 sec to pass the test... I don't like this it's not reliable. </p>
  
  <p>Error I'm getting:</p>
  
  <pre><code>[header1,header2, before,before]
  [header1,header2, after,after]
  
  false was not equal to true
  ScalaTestFailureLocation: NonSense at (NonSense.scala:38)
  Expected :true
  Actual   :false
  </code></pre>
  
  <p>Code Snippet below:</p>
  
  <pre><code>import java.io.File
  import java.nio.file.{Files, Path, Paths}
  
  import org.apache.commons.io.FileUtils
  import org.scalatest.{FlatSpec, Matchers}
  
  class NonSense extends FlatSpec with Matchers {
  
    val classLoader: ClassLoader = getClass.getClassLoader
    val testAclsPath: Path = Paths.get(classLoader.getResource("file/test.csv").getPath)
  
    def withTempConfigFile(block: (Path) =&gt; Unit) {
      val tempDir: Path = Files.createTempDirectory("test")
      val tempCsv = new File(tempDir.toFile, "test.csv")
      val path = tempCsv.toPath.toAbsolutePath
      Files.copy(testAclsPath, path)
      block(path)
    }
  
  
    "changing a file" should "change last modified timestamp" in {
      withTempConfigFile { (path) =&gt;
          // refresh and get current Acls
          val lastModified = path.toFile.lastModified
          // read CSV
          val file = path.toFile
          val lines = FileUtils.readLines(file, "UTF-8")
          System.out.println(lines)
          // delete the last line
          val deletedLine = lines.remove(lines.size() - 1)
          // add a line
          lines.add("after,after")
          // write to file
          // Thread.sleep(10) doesn't change anything, but Thread.sleep(1000) does
          FileUtils.writeLines(path.toFile, "UTF-8", lines, false)
          val linesChanged = FileUtils.readLines(file, "UTF-8")
          System.out.println(linesChanged)
          // assert the obvious - not working
          path.toFile.lastModified() &gt; lastModified shouldBe true
        }
    }
  
  }
  </code></pre>