DOORS DXL:如何创建文件夹

DOORS DXL: How to create a folder

我目前有一些代码可以在不存在具有适当名称的文件夹时创建一个文件夹。但是,即使它到达告诉我该文件夹已创建的代码,但当我查找它时,它不存在。该文件夹应该被写入桌面,但没有出现任何新内容。这是我正在使用的代码:

if (!fileExists_(BL_TO_BL_DIR) {
    infoBox("Creating folder on desktop");
    Folder f = create( "C:\Users\" username() "\Desktop\BL_to_BL Files", "");
    infoBox("Folder created");
}

您将 DOORS 文件夹与文件系统目录混淆了。 在 DOORS 客户端中,您会看到 DOORS 项目,其中包含文件夹 (!),其中包含模块。

在您的计算机上,您有一个带有目录的文件系统。 如果您想与您的操作系统交互,例如 Windows,您将必须使用 DXL 手册第 12 章中提到的命令 "Operating System interface"。在那里您可以找到命令 mkdir。 手册摘录:

Declaration

void mkdir(string dirName [,string osParm])

Operation

Creates directory dirName.

Optional argument osParm can contain information that is dependent on the operating system, such as the UNIX octal file access mask.

Example

The following example creates a typical UNIX path name, and sets the access rights:

mkdir("/usr/development/phase1", "0755")

The following example creates a Windows path, for which there are no access rights:

mkdir("C:\DOORS\DXLExample\", "")