I´m trying to mod a little Program to write text from an Input window to textfile. I´m not very familiar with C and tested a little bit around.
void wr_wprintf(wr_window_t *window, wi_string_t *fmt, ...) {
wi_string_t *string;
va_list ap;
va_start(ap, fmt);
string = wi_string_init_with_format_and_arguments(wi_string_alloc(), fmt, ap);
va_end(ap);
wr_wprint(window, string);
FILE *fp;
fp = fopen("/home/pi/test", "w");
fprintf(fp, string);
fclose(fp);
wi_release(string);
}
The command wr_wprint(window, string); is the output of the text. As you can see I tried already something with fopen. But it did not write the text to file. The file is created but there is nothing inside.