Answer the question
In order to leave comments, you need to log in
Android how to create a folder using NDK?
I saw on the Internet only options with java. And my game uses only native code. You need to create a folder in order to write a text document to the specified address. When such a path exists, the file will be created without problems, and when such a path does not exist (I delete the folder), then the file is not created. Why is this happening?
Answer the question
In order to leave comments, you need to log in
The function mkdir
[ ? ].
Its behavior for Android is no different from that stated in the official documentation.
You can use the stat
[ ? ], or you can rely on the error code EEXIST
from mkdir
.
When such a path exists, the file will be created without problems, and when such a path does not exist (I delete the folder), then the file is not created. Why is this happening?
delete folder
how to create a folder?
It is logical to check if the directory exists, if so, then create a file, otherwise, create a directory and a file in it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question