Search code examples
androidfilefilesystemsfile-renamefile-move

Does a file operation (move, rename) change last modified field of a file?


What does "lastmodified" describe? Just the file's content or also file system related things like file name and Path?

My interest goes especially for the Android platform. I will store data in my app's directory. A quick test showed, that a Samsung Android device with Android 4.2.2 does not change the date when moving files with the build in file browser.


Solution

  • from my experience it doesnt change it. After such operations I manually do

    file.setLastModified(System.currentTimeMillis());