/tmp/ 文件夹中的照片何时在 iOS 过期

When do photos expire on iOS in /tmp/ folder

在 iOS 应用程序上使用相机时,iPhone 将临时照片保存到此文件夹:

file:///var/mobile/Containers/Data/Application/3823983289389/tmp/cdv_photo_138.jpg

这些什么时候过期? iOS 会在一段时间后删除这些内容吗?它有多长,或者您可以通过编程方式调整它吗?

您无法控制 tmp/ 文件夹中文件的生命周期。你所知道的是 OS 可能会在你的应用不是 运行.

时随时清除此类文件

来自documentation

Put temporary data in the tmp/ directory. Temporary data comprises any data that you do not need to persist for an extended period of time. Remember to delete those files when you are done with them so that they do not continue to consume space on the user’s device. The system will periodically purge these files when your app is not running; therefore, you cannot rely on these files persisting after your app terminates.