Quote:
Originally Posted by
platinumedge
I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories.
but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory structure.
I know Linux command "mkdir -p /home/blah1/blah2/blah3" would create all the sub-directories if it doesn't exist.
how to achieve the same "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist
I'm using Redhat Linux 9 on Intel board 915GLVG
The best way is probably to iterate and call mkdir and chdir every time.
I'm actually in the process of doing something similar, and that's the way I'll go.
Constructing the (full) path every time is quite annoying, while changing the working
directory should be more easy.
S.