Thanks for the instructions.
But I am more concern if I need to clean up the folder by my app or not?
Thanks for the instructions.
But I am more concern if I need to clean up the folder by my app or not?
I don’t believe you do unless you’re generating a lot, but the OS should do it for you. Just make sure if you are opening the files you are also closing them (the system calls like loading photos and such should close properly)
Rob
Is the same applied to Android too?
Android OS will clean up the temporary folder too? Just leave it for Android OS?
As far as I know, Android also cleans up the temporary folder.
Rob
Thanks, Rob.
If not, I think Corona document should have some kind of note about the temporary folder usage.
There are more than one users telling me they see the size of my app’s folder is increasing. As you know, the users don’t really know what they are looking at. I am telling them the OS will take care of the temporary folder. And I also try to ask them what kind of tool they are using and what kind of data they are seeing in order to know exactly what they are talking about. But they have not responded back.
I do think they are referring the temporary folder. And as long as the OS is taking care of it, it’s fine then. Otherwise, it will be a mess for me app (over 30k downloads already).
I’ve confirmed with Engineering that on both iOS and Android, the OS cleans up temp space when it needs more space at it’s rhyme and reason. But if you know your going to be creating a lot of temporary files, it would be good of you to clean up after yourself.
Thanks a lot, Rob. It should be fine then.
And I added some code during my app startup to clean up some files in the temporary folder in case some users like to monitor app resource usages. I guess this kind of tools counts the temporary folder into the total file space usage.
@Rob I found that in iOS setting->general->usage, I can see all app storage usage stats. And I found that my app storage keeps increasing even if I store all downloaded images in the system temporary folder. Why is the system temporary folder counted in this statistic also? This makes users think my app is eating their storage capacity. I am really afraid I may miss something here?
It’s correct behavior on IOS’s part as any file in the sandbox takes up space until it’s specifically removed.
The difference is that iOS take the priveledge to delete files in the Temporary or Cache directories. However for that to happen, all disk space must be close to being full.
This is a quote from the iOS documentation
---------quote
Put data cache files in the /Library/Caches directory. Examples of files you should put in this directory include (but are not limited to) database cache files and downloadable content, such as that used by magazine, newspaper, and map apps. Your app should be able to gracefully handle situations where cached data is deleted by the system to free up disk space.
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.
------end quote
Thanks ingemar. It’s kind of different than what Rob told me. I think I shouldn’t put downloaded images in temporary folder if it’s the case.
You should probably put downloaded images into system.CachesDirectory, but you probably should have some limit to how long they live. This isn’t drastically different than what I said.
Rob