为什么DOORS DXL tempFileName函数在Windows 7 64位上返回\?

时间:2013-06-25 19:41:44

标签: file-permissions windows-7-x64 temp ibm-doors

我在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"

1 个答案:

答案 0 :(得分: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”。