Hey all! I am working on a project that will store JSON files that will be keyed by a user ID and a version of the file in Application.persistentDataPath. One thing I am unsure of is how to clean up the old files, in order to have the storage not grow out of control on the device.
So, for example, if the file name testConfig, the userID == xyz and the version is 1.1, I would store this file as:
testConfig-xyz-1.1.
When version 1.2 comes out, it would then store:
testConfig-xyz-1.2
This is done so that different users can have different config files.
How do I clean up the old versions? Is there a way using Application.perisistentDataPath to see the contents in the directory? Is there a way to make subfolders in that location, so that the subfolder could be removed entirely?
Any other ideas?