2022-09-13, 05:34 AM
So you want to check if:
- A directory exists or not
and if not:
- Create it
What kind of stupid assumption is that? Did you even check out the plugin? It can do exactly what you want:
If you meant you want a function that does both things at once you'd have to create your own function.
And that's as simple as this:
Consider using this one?https://github.com/JarnoKai/SA-MP-FileManager/
- A directory exists or not
and if not:
- Create it
Quote:apart from filemanager which probably also doesn't do what i'm asking for
What kind of stupid assumption is that? Did you even check out the plugin? It can do exactly what you want:
Code:
if (!dir_exists("scriptfiles/my_directory/"))
{
? ? dir_create("scriptfiles/my_directory/");
}
If you meant you want a function that does both things at once you'd have to create your own function.
And that's as simple as this:
Code:
dir_check(const dirname[])
{
? ? if (!dir_exists(dirname))
? ? {
? ? ? ? dir_create(dirname);
? ? }
}
Code:
dir_check("scriptfiles/my_directory.");
Consider using this one?https://github.com/JarnoKai/SA-MP-FileManager/