Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DOORS 9.7 : DXL and mkdir

Under DOORS 9.7, with DXL, I want to create a directory on my WINDOWS 11 workstation.

So I use the command: mkdir ("C:\Toto", "")

The "C:\Toto" directory is successfully created.

Then I use the command: mkdir ("C:\Toto\Tata\Titi", "")

The command fails and the "C:\Toto\Tata\Titi" directory is not created because "C:\Toto\Tata" does not yet exist...

Is there an option that allows "C:\Toto\Tata\Titi" to be created even if "C:\Toto\Tata" does not exist (an equivalent of "-p" under UNIX)? I should point out that my DOORS 9.7 client is running under WINDOWS 11.

Thank you for your help.

0 votes



One answer

Permanent link

In the meantime, I work around the problem with a function that takes care of creating the non-existent subdirectories :


void createUpDir (string rootDir) {
Regexp SUBDIR = regexp2 "^(.)\\[^\\]+

void createUpDir (string rootDir) {
Regexp SUBDIR = regexp2 "^(.)\\[^\\]+$"
string myUpDir
Stat dirHandle
if (SUBDIR rootDir) {
myUpDir = rootDir[match 1]
dirHandle = create (myUpDir)
if (null dirHandle) { // ---- Directory does not exists ! Create it ...
print "Create Upper Dir = " myUpDir "\n"
createUpDir (myUpDir) // ---- Recursive call to create upper upper directory, if necessary
mkdir (myUpDir, "")
}
}
return
}
quot;
string myUpDir
Stat dirHandle
if (SUBDIR rootDir) {
myUpDir = rootDir[match 1]
dirHandle = create (myUpDir)
if (null dirHandle) { // ---- Directory does not exists ! Create it ...
print "Create Upper Dir = " myUpDir "\n"
createUpDir (myUpDir) // ---- Recursive call to create upper upper directory, if necessary
mkdir (myUpDir, "")
}
}
return
}

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 26, 4:26 a.m.

Question was seen: 235 times

Last updated: Aug 26, 6:01 a.m.

Confirmation Cancel Confirm