2013-06-25 36 views
1

我在Windows 7 64位上安裝了IBM DOORS。當我運行DOORS DXL函數tempFileName()時,我得到\而不是像C:\ Users \\ AppData \ Local \ Temp這樣的東西。我一直在搜索這個問題,但沒有看到有關這個問題的任何信息。任何人有想法?爲什麼在Windows 7 64位上DOORS DXL tempFileName函數返回?

一些示例代碼演示問題是...

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" 
+0

你也可以發佈你的代碼。我在windows 7 64位機器上運行'print tempFileName()'並獲得正確的響應。 –

+0

@Steve,昨天我們找到了根本原因。爲了完整起見,我繼續併發布了一些示例代碼來說明問題。感謝您提供幫助! – buzz3791

回答

1

的根本原因是,計算機的運行門都TEMP設置爲 ℃的「系統變量」:\用戶\用戶名\ AppData \ Local \ Temp並且沒有爲TEMP設置的「用戶變量」 。

要獲得功能工作:

  1. 「系統變量」爲TEMP改爲的「%SystemRoot%\ TEMP」
  2. 創造了另一個「系統變量」稱爲「TMP」並將其設置爲「%SystemRoot%\ TEMP」。
  3. 創建2個「用戶變量」:TEMP和TMP並將它們設置爲「%USERPROFILE%\ AppData \ Local \ Temp」。
相關問題