I am a noob when it comes to Linux so please keep that in mind.
I’m working on a project that reads sensor data from 6 accelerometers using RPi 4B running DietPi and a custom C program. Right now I’m storing data on SD card. What I want is for the end user to get data on his Windows PC as easily as possible so I was thinking of saving data as it gets recorded to USB flash drive (as txt file). End user wants a simple procedure: record data on a flash drive, import it to Matlab, do analysis.
I am thinking of 2 ways how could this be done but I don’t have the knowledge (yet) to implement it into my project:
1.) In C program do a function that checks if flash drive is inserted and then stores data on a flash drive which is FAT/NTFS formatted. There are 2 issues here: I don’t know how to check if flash drive is inserted on Linux in C and second can I save data to FAT/NTFS formatted flash drive?
2.) Write a script that copies previous file to the flash drive when new file is created.
Any pointers would be helpful.