Hi,
I want to save some data on SD card or USB storage. In SSH terminal I found that my SD card is in /media/SDCARD. When I write in text file from application, data is not stored on SD card - I remove SD card but still I can access to this file.
Could you please help me with saving data to SD card or USB storage?
Can I set write rights to SD card or USB from appconfig_0?
For testing I use:
- Verdin development board ver 1.1B
- Toradex Verdin iMX8M Plus WB
- Visual Code with Torzin extension
- .Net 5 Blazor application
In appconfig_0 in volumes I add
/media/SDCARD /SdCard
In container SSH terminal I run command
chmod -R 757 /SdCard
Code snippet for adding data in text file
string[] lines = { "First line", "Second line", "Third line" };
var file = Path.Combine("/SdCard", "test.txt");
using (StreamWriter outputFile = new StreamWriter(file, true))
{
foreach (string line in lines)
outputFile.WriteLine(line);
}
Regards