I want to create a directory that parents doesn't exist. For example i want to create "/etc/dir2/mydir" path. "dir2" directory and "mydir" directory doesn't exist.
When i use mkdir(path, 0x01FF) function (that path is "/etc/dir2/mydir"), it can't create "mydir" because "dir2" directory doesn't exist.
How can i solve this problem? I want to create path suddenly same as "mkdir -p /etc/dir2/mydir" command in Linux, i don't want to create path step by step: first dir2 then mydir.
Please guide me.