The mkdir command is different than the mkdir system call -- there is not a one-to-one correspondence between command options and system call options. To use the mkdir(2) system call in this manner, in your program, you'll need to tewst if each level of the parent directory (below the root) exists, and if not make it. Alternatively, you could just try to make the directory, check for the ENOENT error return and if you get it cycle through the path and find the missing component(s).
|