I’ll like to find out if it’s suitable for me to store the input from a serial port to a buffer or to another files(the input are continuous). If the input are to be stored in another file, how can i go about writing the commands???
Assuming you can talk to your sensor through the serial port, it is pretty easy to talk to the serial port. You can simply open() or fopen() the port, read() or fread() the data, then either write it to a file, or keep it in memory as appropriate.
All in all, we need more info to provide you with a more specific answer.