0

I've an android app that writes files to the disk frequently. I want to write a cleanup module that would find files that are not accessed in last x days and report/clean them up.

Since the filesystem would generally be noatime. I was wondering what would be a nice design to go ahead with this?

atuljangra
  • 457
  • 1
  • 5
  • 9

2 Answers2

0

I needed something similar, but I found out that android doesnt have implemented "time of last access", so I created database where I save access time when user opens the file. Maybe you can use something similar if user is opening files through your app.

SILL
  • 66
  • 5
  • For my use, going back and tracking every file would be difficult. Besides I'm looking for a solution on cleaning up already exising files. – atuljangra Feb 06 '17 at 20:50
0

I believe you can achieve what you need using the stat command - you can look here for an example: Last Accessed Time of any file in Android

Community
  • 1
  • 1
yakobom
  • 2,681
  • 1
  • 25
  • 33