0

I would like to know what I should do in order to change the return value of lastAccessTime

System.out.println("Last Access time is:"+basicAttributes.lastAccessTime());
System.out.println("Last Modified time:"+basicAttributes.lastModifiedTime());

Even though I access the file I called the readAttributes on.. the lastAccessTime() methods does not update the value with the time I last accessed the file.. I am using ubuntu and that attribute should be supported.. What's wrong with that?

Thanks in advance.

Rollerball
  • 12,618
  • 23
  • 92
  • 161

1 Answers1

1

The operating system isn't obliged to update the directory every time you access the file. Mostly they do it when you close the file.

user207421
  • 305,947
  • 44
  • 307
  • 483