how to create a folder at the run time ?

hi there!

could someone please tell me how to create a folder out of the application folder, so that in case of uninstalling the app, it remains on the system.

thx in advance,hey there,

how to create a folder outside of the application directory so that it remains on the disk after uninstalling
the app on the platform

thx in advance

You probably just want to use the persistentDataPath. Unity creates this folder for your application automatically. You shouldn’t store files in some other random locations on a client computer since you don’t know how they actually organise their HDD space and where you actually have permission to create files or folders. The persistent data path is specifically made for this task.

You haven’t mentioned the actual platform you build for. The persistent data path should work for most platforms. Though certain platforms (especially mobile) might even have more restrictions. For example on Android without requesring explicit permission you are not allowed to write anywhere besides your applications reserved folder.

Since you haven’t mentioned for what actual task / purpose you want to do this and what platform you want to target we can’t really recommend alternatives.

thx for your prompt answer.
In fact i am developing an app intended to perform on Smartphone either Android or iOS.
since i do not know how to develop an update of an app, i thought it easier to uninstal the old Version preserving specific files(e.g. user’s data) before installing the new one