From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get System Directory - User Application Data question

When I use Get System Directory with the User Application Data folder type, I get C:\<user>\AppData\Local. What I'm wanting is to get C:\<user>\AppData\Roaming.

Use case here is that I want to check whether the user has saved SVN authentication data in "Roaming\Subversion\auth".

 

I can strip path and replace Local with Roaming but I'm a bit worried that I'm throwing away some of the goodness that Get System Directory is giving me if I do so.

 

I'm hoping I'm missing something simple. Otherwise, I might put in an Idea Exchange to have Get System Directory only drop me into the C:\<user>\AppData directory instead of C:\<user>\AppData\Local.

 

Anybody have any better ideas or workarounds for this? 

 

EDIT: My actual SVN issue I have a workaround for. I'm still curious about the Get System Directory behavior. For my SVN issue, I can just command line a --non-interactive and then parse the error string if authentication fails.

0 Kudos
Message 1 of 5
(3,117 Views)

You could try implementing this yourself. A quick look through the microsoft MSDN shows the following as being the most likely candidate

 

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx

 

Of course, this raises the questions of is the effort to get that working more worthwhile than simply using strip path?

 

0 Kudos
Message 2 of 5
(3,097 Views)

@OEM_Dev wrote:

 

 

Of course, this raises the questions of is the effort to get that working more worthwhile than simply using strip path?

 


Yeah. I don't want to get involved with reimplementing Get System Directory myself. The whole reason for using Get System Directory is so I don't have to reimplement it for OS changes. It seems like a bit of an oversight if the NI implementation ignores LocalLow and Roaming. Defaulting to Local is not a bad choice. It probably should be documented in the function help.

(i.e. the effort clearly isn't worth it for me. For NI on the other hand . . . 😛 )

 

EDIT: Is it unreasonable to expect to be able to get at all of these from Get System Directory? It might be since I'm sure different OSes are going to handle this differently. I really don't know.

0 Kudos
Message 3 of 5
(3,088 Views)

http://zone.ni.com/reference/en-XX/help/371361H-01/glang/get_system_directory/

 

What option are you using as your input?  If you change it, does the path change from Local to one of the other directories you want?

0 Kudos
Message 4 of 5
(3,066 Views)

@natasftw wrote:

 

 

What option are you using as your input?  If you change it, does the path change from Local to one of the other directories you want?


I'm using User Application Data. Digital representation is 3. None of the NI selectable options gives me the directory I want. I could use User Home and then add AppData\Roaming or I could use User Application Data and strip Local.

 

According to the MSDN link I provided, there are three directories on Windows which could correspond to User Application Data. AppData\Local, AppData\LocalLow, and AppData\Roaming. As mentioned before, pointing to AppData\Local is a reasonable choice. It's just unfortunate that SVN chose AppData\Roaming instead of AppData\Local and NI picked AppData\Local.

0 Kudos
Message 5 of 5
(3,056 Views)