Skip to content
Advertisement

Making Directory in C Program [closed]

For my assignment, I’ve to write a function to create a directory but I’m not allowed to use SYS functions at all! Is there any other way? I’ve been searching for it everywhere but didn’t find anything that actually works. The function must at least work on Linux.

Advertisement

Answer

This should work on Linux (not sure what you mean with “sys functions”, so it might be disallowed):

#include <sys/stat.h>    
mkdir("/tmp/foobar", 0);
Advertisement