LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
SpaghettiCoder

Allow Default Data Directory relative to User Profile

Status: New

The default Data Directory path is set to "%Userprofile%\Documents" under windows. 

This is fine regarding custom probes, settings etc, but problematic when it comes to the compile cache and other "runtime" files.

 

In our corporate setting, this folder is always synced with onedrive AND with the roaming profile. So one problem is, that it bloats the synced volume, which by it self is annoying. But it often leads to corrupt files when onedrive blocks them or writes them in the wrong moment. 

 

So our workaround is to set this path to %programdata%\LabView Data. This, however, brings new problems, since now all users need write access to this folder.

 

I think a better way would be to save the folder under %localappdata%, but this can not be done with a symblic path and must be defined static, so it works just for one user.

 

Solution:

Provide a symbolic link to the %useroprofile% or %localappdata% folders. Additionally it would be nice, if the cache target folder could be seperately defined.

2 Comments
rolfk
Knight of NI

I usually use the function Get System Directory under File I/O->File Constants to get a path to any of these directories, including %localappdata%. Most of the times wrapped into a project VI that appends a project specific directory and makes sure that directory exists. Much more flexible and doesn't require tinkering with Windows configurations that will have to be reconfigured on every installation.

 

The default User Documents directory idea from Microsoft is flawed but it is the way Windows applications are supposed to work. So rather than fighting that, simply define your own preferred setup.

Rolf Kalbermatter
My Blog
SpaghettiCoder
Member

Hi Rolf,

thanks for your response.

Regarding project files I usually do the same. But the problem arises from the "AppBuilderCache" and "ViObjCache" folders, that are created in the "Default Data Directory".

Because of the named reasons, these two cache folders should be created in an always local, user owned directory, maybe localappdata or even "temp".

 

So maybe the correct solution would be to allow a dedicated path for object cache files and maybe point the default to a more suitable setting.