We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5315694 commit 1ff8341Copy full SHA for 1ff8341
mkdir.cpp
@@ -0,0 +1,13 @@
1
+#include <sys/types.h>
2
+#include <sys/stat.h>
3
+#include <unistd.h>
4
+
5
+//https://stackoverflow.com/questions/7430248/creating-a-new-directory-in-c
6
7
+int main(){
8
+ struct stat st = {0};
9
10
+ if (stat("newdir", &st) == -1) { //checking if the directory exists
11
+ mkdir("newdir", 0700);
12
+ }
13
+}
0 commit comments