system.TemporaryDirectory vs system.CachesDirectory

Just some quick questions regarding various directories. The documentation says that system.TemporaryDirectory “… may not exist after the application exits.” How consistent is this “may?” Does this directory get removed every time? Every 2 or 3 runs? Or is it OS dependent? 

Moving onto Caches directory. The documentation says that for iOS data in this directory is not backed up to their cloud. Is it then correct to say that on Android this functions the same as the Documents Directory?

According to Apple, the temp directory can be cleared at any time so you should assume it will not be there between executions. I couldn’t say that it would be cleared during application suspension, but don’t count on it. I imagine factors such as free storage space and other applications loading into memory will have an impact.

I can’t say about the caches directory, I’m afraid.

I’m pretty sure that system.CachesDirectory = system.TemporaryDirectory on Android. 

Apple doesn’t want you putting downloadable content (that can be re-downloaded) in system.DocumentsDirectory since it is by default backed up to the cloud where system.CachesDirectory is not.  If you need something permanent and you don’t want to risk the possible cleaning of Caches, you can download to system.DocumentsDirectory but you will need to flag the images as not being backed up to iCloud using:

http://docs.coronalabs.com/api/library/native/setSync.html

According to Apple, the temp directory can be cleared at any time so you should assume it will not be there between executions. I couldn’t say that it would be cleared during application suspension, but don’t count on it. I imagine factors such as free storage space and other applications loading into memory will have an impact.

I can’t say about the caches directory, I’m afraid.

I’m pretty sure that system.CachesDirectory = system.TemporaryDirectory on Android. 

Apple doesn’t want you putting downloadable content (that can be re-downloaded) in system.DocumentsDirectory since it is by default backed up to the cloud where system.CachesDirectory is not.  If you need something permanent and you don’t want to risk the possible cleaning of Caches, you can download to system.DocumentsDirectory but you will need to flag the images as not being backed up to iCloud using:

http://docs.coronalabs.com/api/library/native/setSync.html