LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selecting the temporary directory at runtime

Is there a way that I can allow a user running a code compiled under LV2011 to adjust their temporary directory? This is the path that is returned by the Temporary Directory Function.

 

In an older version of the code, which was built under LV6.1, the user could pull down the following menus: Tools/Options/Paths. But that menu selection is no longer offered when I compile the code now.

 

0 Kudos
Message 1 of 6
(2,928 Views)

Hi efarr

 

Does it have to be the temporary directory? There a great article here which shows how to get/set the current working directory.

Having checked MSDN there is a GetTempPath method in kernel.dll which you can access but I can't see an equivalent set function, it's a system-wide property which I'm not sure is designed to be changed by applications like LabVIEW.

 

Kind Regards

Chris | Applications Engineer NIUK
0 Kudos
Message 2 of 6
(2,922 Views)

Chris,

 

I inherited a large code that makes extensive use of the Temporary Directory function. It would be easier to control the location of that function than to make lots of changes to the code. Former users of the code report that they fixed "file not found" problems by adjusting the temporary directory using menus

 

     Regards,

0 Kudos
Message 3 of 6
(2,912 Views)

Hi efarr

 

You should be able to change the temporary directory in LV2011 via the 'Tools' >> Options menu as discussed here

You said it's not available - could you show me a screenshot of what you mean?

 

Kind Regards

Chris | Applications Engineer NIUK
0 Kudos
Message 4 of 6
(2,902 Views)

While I'm building code, that works. But not when I'm executing a built app.

 

In other words, we used to fix the problem by having the user to adjust the Temporary directory while running the bult app.

0 Kudos
Message 5 of 6
(2,892 Views)

Hi

 

Setting the directory via Tools >> Options writes changes to the LabVIEW.ini file. In the case of the temporary directory it's the line 'tmpdir=C:\wherever_you_want'

You can add the same line to your applications ini file to the same effect.

 

Hope this helps.

Chris | Applications Engineer NIUK
0 Kudos
Message 6 of 6
(2,888 Views)