Hi Fabian,
you can just use /tmp in your snap as the file location. The snap is then using a for your snap specific /tmp directory, which is a subdirectory of the host’s /tmp.
I quickly tried it out with the hello.world example of the SDK to make it clearer. I added these lines to the code:
// Create and open a file
std::ofstream MyFile("/tmp/tmpfile.txt");
// Write something to the file
MyFile << "Sample Text!";
// Close the file
MyFile.close();
And then the file was created here (I logged into the ctrlX CORE virtual with ssh):
I did not need to do any changes in the snapcraf.yaml.
Best regards,
Nick
... View more