Change location of temporary/cache files from `%ENSENSO_INSTALL%/settings/*` to another directory

General Information

  • Product: C57-6-M / N36-601
  • Serial Number: 201234
  • Ensenso SDK Version: 4.1.1033
  • Operating System: Linux

Problem / Question

After upgrading the Ensenso SDK to version 4.1.1033, we noticed that the NxLib/camera_cache.json file and possibly other temporary/cache files are now created in the %ENSENSO_INSTALL%/settings directory.
We would like to store these files in a different temporary directory instead of the SDK installation directory.

Is there a way to change only the cache file’s save location without modifying the ENSENSO_INSTALL environment variable?

Hello,

To set the settings folder in your application (works), you can call the following before the nxLibInitialize call:

//...
NxLibItem("config:/SettingsPath") = "/your/new/folder";
nxLibInitialize();
//...

This is an undocumented feature and your settings will be placed in /your/new/folder/settings. If you want to use another SettingsFolder in e.g. NxView you can set the NXLIB_CONFIG_TREE environment variable while calling it, NXLIB_CONFIG_TREE='{"SettingsPath": "/your/new/folder"}'. NxView and its NxLib will use /your/new/folder/settings in this case too.

A new Version of ensenso sdk will be released very soon and it will have additional options. You will be able to use the 4.2 ensenso sdk as a portable version by unpacking an archive that can be used independent to other ensenso sdk installations using an settings folder inside the unpacked archive.

Kind regards,

Joel

In SDK 4.2 which has just been put online you can check the locations used for storing different types of data in the Path item in the API.

This solution works well for changing the settings directory. Thank you for your support!