1

我在 Windows 7 64 位上安装了 IBM DOORS。当我运行 DOORS DXL 函数 tempFileName() 时,我得到 \ 而不是 C:\Users\\AppData\Local\Temp 之类的东西。我已经用谷歌搜索了这个问题,但没有看到任何关于这个问题的信息。有人有想法吗?

一些演示问题的示例代码是......

string productDetailsFile = tempFileName()
print "productDetailsFile = " productDetailsFile "\n"
if(canOpenFile(productDetailsFile, true))
print "Can write to file\n"
Stream out = write productDetailsFile
out << "Created by " doorsname " at " dateAndTime today ""   
if (null out)
{
    print "Could not create file " productDetailsFile ""
    halt
}
flush out
close out
string directory = getDirOf (productDetailsFile)
print "directory = " directory "\n"
string newFileName = directory NLS_("\\") NLS_("DOORS_") doorsInfo(infoVersion) (NLS_(".xml_new"))
print "newFileName = " newFileName "\nAttempting to rename now\n"
string errorMsg = renameFile(productDetailsFile, newFileName)
if (!null errorMsg)
{
    print "Rename failed with error - " errorMsg "\nTrying with modified file name now\n"
    newFileName = directory NLS_("DOORS_") doorsInfo(infoVersion) (NLS_(".xml_new"))
    print "newFileName = " newFileName "\nAttempting to rename now\n"
    errorMsg = renameFile(productDetailsFile, newFileName)
    if(!null errorMsg)
        print "Still fails. Stopping script now, please send the DXL Output to Support"
 }
 else
     print "Rename successful"
4

1 回答 1

1

根本原因是运行 DOOR 的计算机将 TEMP 的“系统变量”设置为 C:\Users\user-name\AppData\Local\Temp,并且没有为 TEMP 设置“用户变量”。

要使功能正常工作:

  1. TEMP 的“系统变量”已更改为“%SystemRoot%\TEMP”
  2. 创建另一个名为“TMP”的“系统变量”并将其设置为“%SystemRoot%\TEMP”。
  3. 创建了 2 个“用户变量”:TEMP 和 TMP,并将它们设置为“%USERPROFILE%\AppData\Local\Temp”。
于 2013-06-27T15:55:07.803 回答