开发者

file lastModified() changes by itself

having some trouble with file.lastModified() under Android OS. I developed a file synchronization app which relies on correct detection of file changes.

Heres the problem: Although the method of retrieving the modification timestamp is the same throughout the app every now and then different times are read even if the file wasn't touched at all. Those readings differ after a day or two but never directly after one reading.

Now the funny thing is that the offset between previous and actual readings are in my case exactly 2 hours. For me, two hours is my offset to GMT. OK - so far no idea.

Story continues: Some days later I read back another wrong value but now the offset is negative so I am back to my old (correct) value.

I can't provide much code because there is practically none. I read out lastModified() as long and store it in a SQLite database. Then compare those values later.

So I have a whole bunch of questions:

  • Is it even possible that Android reports other values than GMT timestamps?开发者_高级运维
  • How can my files modified date change by exactly two hours without altering the file?
  • Does anyone know how to track down what causes that modification date to change or how the offset occures?

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜