Domanda

I have IBM DOORS installed on Windows 7 64-bit. When I run the DOORS DXL function tempFileName() I get \ instead of something like C:\Users\\AppData\Local\Temp. I've googled this problem but don't see anything about the issue. Anyone have an idea?

Some sample code demonstrating the problem is...

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"
È stato utile?

Soluzione

The root cause was that the computer running DOORs had a "System variable" of TEMP set to C:\Users\user-name\AppData\Local\Temp and there were no "User variables" set for TEMP.

To get the function working:

  1. The "System variable" for TEMP was changed to "%SystemRoot%\TEMP"
  2. Created another "System variable" called "TMP" and set it to "%SystemRoot%\TEMP" as well.
  3. Created 2 "User variables": TEMP and TMP and set those to "%USERPROFILE%\AppData\Local\Temp".
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top