The following will create a file in user space but how can I create a directory?
struct file *filp = filp_open("/home/myuser/Desktop/newfile", O_CREAT, S_IRWXU);
The following will create a file in user space but how can I create a directory?
struct file *filp = filp_open("/home/myuser/Desktop/newfile", O_CREAT, S_IRWXU);
The best way I know how is to use:
mkdir("your/directory", 0700);
David Heffernan's comment shows the specifics.
Edit: This page will show you the different mode parameters you can give for your directory and what they do.
http://osdir.com/ml/linux.c-programming/2002-06/msg00069.html
Just set O_DIRECTORY
in filp_open
flags.