Confirming how mkdir works #13127
-
Hi tauri devs, just want to confirm this documentation here:
When I tried using it on the AppData folder it return an error that says that the folder does not exist, now for context I already know that the 'images' does not exist thats why I want to add it, now in order to solve this I delved deep in the documentation with the help of AI and it was solved by adding recursive. Should we add the recursive property in the documentation? Or is this normal, because I thought that just by using the one already on the doc it will work but apparently its not the case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
we could at least mention the recursive property there |
Beta Was this translation helpful? Give feedback.
BaseDirectory.AppData is not the same as the window AppData directory (if that's what you thought). The BaseDirs starting with
App
are application specific directories (basically means they use your bundle identifier as the dir name) and Tauri does not create any dirs it does not need itself so there's a high chance that AppX directories do not exist until you create them (either explicitly or via the recursive option).The example in the docs doesn't really care about that behavior though and i guess in this case you could say it assumes you know that already.