简体   繁体   中英

Find files not accessed in last x days on android

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?

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.

我相信您可以使用stat命令来实现所需的功能-您可以在此处查看示例: Android中任何文件的上次访问时间

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM