c - mkdir system call occasionally creates unreadable directory -


i'm taking in ouput folder name argument argv[] , executing following code:

mkdir(outputname, "0777"); 

and work fine , create folder correct permissions folder created , won't able access folder. common problem problem simple fix?

you're sending string mkdir mode, , wrong type. if include correct headers compiler should warn this. fix simple enough,

#include <sys/stat.h> #include <sys/types.h> ... mkdir(outputname, 0777); 

Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -