write to file
This commit is contained in:
parent
9326e6e09a
commit
6bf29bf316
@ -65,6 +65,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
signal(SIGINT, handle_sigint);
|
||||
|
||||
FILE *output_file;
|
||||
output_file = fopen("./abc.txt", "w");
|
||||
|
||||
/* Reading lines from serial port. */
|
||||
bool reading = true;
|
||||
while (reading && !INTERRUPT) {
|
||||
@ -94,8 +97,10 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
puts(buffer);
|
||||
fputs(buffer, output_file);
|
||||
}
|
||||
|
||||
fclose(output_file);
|
||||
free(buffer);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user