- Home /
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
"so that in case of uninstalling the app, it remains on the system."
Do your users consent to that, or is this just for your own education?
Answer by Bunny83 · May 06, 2019 at 05:45 PM
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.
Answer by frted · May 06, 2019 at 06:44 PM
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
Your answer
Follow this Question
Related Questions
Load an external folder full of mp3's into array at runtime c# 2 Answers
creating a directory 2 Answers
How do you create a folder in c#? 3 Answers
create 3d model at runtime 1 Answer
Creating new prefab at runtime 1 Answer