When does iOS clean the local app ./tmp directories?

廉价感情. 提交于 2019-12-10 03:07:17

问题


When does iOS clean the local app ./tmp directory?

Note that this is not a dupe of this question. I'm asking about the app specific temporary folder, not the system wide one.

You can use iExplorer to have a look at ./tmp directories on non-jailbroken phones.

(Note: I'm asking this out of curiosity only. I kind of suspect that these never get deleted unless you restore your phone from a backup or reinstall that particular app. But obviously you cannot count on that for semi-permanently storing cached files.)


回答1:


According to the documentation, it could be any time, if the app is not executing:

The system may also purge lingering files from this directory when your app is not running.

It's logical to assume if a) your app is not running; and b) your device is running low on storage, then it's highly likely the system will, at some point, purge the contents of <Application_Home>/tmp/.

It's also worth noting that the documentation states:

Your app should remove files from this directory when it determines they are no longer needed.

The emphasis here being on the app developer to do their own housekeeping and not leave it for the OS to tidy up after them.



来源:https://stackoverflow.com/questions/25062375/when-does-ios-clean-the-local-app-tmp-directories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!