S
Stefan Nowy
Hello!
I'm getting data from the serial port which is printed on the screen:
do
{
res = read(fd,buf,48);
buf[res]=0;
fprintf(stdout,"%s\n",buf);
}
while (TRUE);
So far so good. Data is received and printed out.
But as soon as I try to write that data in a file it doesn't work.
I tried openening a file and using fprintf(fp,"%s\n",buf); :
my program seems not to execute the above code, although the output-file
was opened correctly...
and on the commandline "./myprog > ouput.txt" creates the output.txt,
but no data occurs...
Can anybody help me?
Thanks and Greetings
Stefan
I'm getting data from the serial port which is printed on the screen:
do
{
res = read(fd,buf,48);
buf[res]=0;
fprintf(stdout,"%s\n",buf);
}
while (TRUE);
So far so good. Data is received and printed out.
But as soon as I try to write that data in a file it doesn't work.
I tried openening a file and using fprintf(fp,"%s\n",buf); :
my program seems not to execute the above code, although the output-file
was opened correctly...
and on the commandline "./myprog > ouput.txt" creates the output.txt,
but no data occurs...
Can anybody help me?
Thanks and Greetings
Stefan