To simply store a file in the active configuration add the plug to your .yaml file:
plugs:
active-solution:
interface: content
content: solutions
target: $SNAP_COMMON/solutions
And then use following code:
#include <fstream>
///// test /////
path = "/var/snap/rexroth-solutions/common/solutions/activeConfiguration/test.txt";
std::cout << "write " << path << std::endl;
std::ofstream outfile (path);
if (outfile.is_open()){
std::cout << "opened: "<< path << std::endl;
outfile << "Test txt with some words\nand two lines\n" << path;
outfile.close();
}
else{
std::cout << "error: " << path << std::endl;
}
If you like to be part of the automatic save and load process of the configuration some more steps have to be done. To get more information please get in contact with your ctrlX World contact person.
... View more