![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Distribution Release: Gentoox 7.0 "Home", 5.0 "Pro" | iBot | Software Releases - RSS News | 0 | 01-25-2009 10:20 AM |
| iCal, Mac OS X 10.5: Empty "Home" and "Work" calendars may appear after installing Le | iBot | OS X Support RSS | 0 | 10-13-2008 10:20 PM |
| iCal, Mac OS X 10.5: Empty "Home" and "Work" calendars may appear after installing Le | iBot | OS X Support RSS | 0 | 10-03-2008 04:40 AM |
| extracting first 1000 lines containing "home"... | Kaminski | UNIX for Dummies Questions & Answers | 2 | 07-22-2008 03:47 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
I see nothing
![]() Quote:
Code:
system("mkdir -p /home/blah1/blah2/blah3");
|
|
|||||
|
Good point I forgot the code: c Code:
|
|
||||
|
Quote:
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. |
|
||||
|
Why not just append to the string instead of recreating every time?
|
|
||||
|
Quote:
I m doing a sequence of mkdir(dir); chdir(dir) for(subdir to create) mkdir(subdir[i]); chdir(".."); and so on, which in my case seems perfect, as I have to create a director hierarchy from a structure (list of list). In his case, it could do something similar. ---------- Post updated at 01:50 AM ---------- Previous update was at 01:44 AM ---------- Quote:
S. |
![]() |
| Bookmarks |
| Tags |
| directory, mkdir |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|