我该如何理解app bundle中的tmp文件夹?它会在某个时刻被清除吗?

时间:2023-01-23 07:25:57

I'm capturing video using my app. I was thinking about saving the captured movie to Documents folder. I've explored project bundle and saw the captured movie is saved 2times. It's in tmp and also in my Documents folder. Will tmp folder be cleared or something? Or it's ok to keep the captured movie only in tmp? Thanks in advance.

我正在使用我的应用程序捕获视频。我正考虑将捕获的电影保存到Documents文件夹。我已经探索了项目包,看到捕获的电影被保存2次。它在tmp中,也在我的Documents文件夹中。将tmp文件夹清除还是什么?或者只能在tmp中保存捕获的电影?提前致谢。

1 个解决方案

#1


1  

These files might be deleted at some point when your app is not running.

当您的应用未运行时,可能会删除这些文件。

The /tmp/ directory is meant for files that you don't need to persist between launches of your app. The correct directory to use depends on the requirements of your app.

/ tmp /目录适用于在应用程序启动之间不需要保留的文件。要使用的正确目录取决于您的应用程序的要求。

There's a good description of this in Apple's File System Programming Guide under iOS Standard Directories: Where Files Reside and Where You Should Put Your App’s Files.

在iOS标准目录下的Apple文件系统编程指南中有一个很好的描述:文件驻留位置和应放置应用程序文件的位置。

#1


1  

These files might be deleted at some point when your app is not running.

当您的应用未运行时,可能会删除这些文件。

The /tmp/ directory is meant for files that you don't need to persist between launches of your app. The correct directory to use depends on the requirements of your app.

/ tmp /目录适用于在应用程序启动之间不需要保留的文件。要使用的正确目录取决于您的应用程序的要求。

There's a good description of this in Apple's File System Programming Guide under iOS Standard Directories: Where Files Reside and Where You Should Put Your App’s Files.

在iOS标准目录下的Apple文件系统编程指南中有一个很好的描述:文件驻留位置和应放置应用程序文件的位置。