views:

43

answers:

1

Hi everybody,

I have a question from this stackoverflow question about iPhone storage. Like I already tried to answer, we can cache data in tmp directory. But a comment says that the data can be deleted when OS whimp. I don't understand exactly the problem that the comment says.

I want to ask if the process of OS deleting tmp directory is manually or automatically. In other words, if the system auto detect that our tmp directory has to be deleted.

Another question is that if we can control, or be asked to do something (before the deleting process) that can help us to keep the tmp directory.

Another question is that if we can not do anything then how often the OS will do that, under what circumstances

+1  A: 

The OS will delete the temp directory on restart and at other indeterminate points. If you need to store something somewhere that you don't want backed up then use the cache directory. That will not be deleted and will not be backed up.

Your application will not be running when the temp is deleted nor will you have an opportunity to react to that deletion. This is fairly common behavior on all unix based platforms (OS X does this as well).

Marcus S. Zarra
one more question is where I can store something that can be backed up and not be deleted as well
vodkhang
To be backed up and not deleted, it needs to be in the documents directory.
Marcus S. Zarra