In my codes, fprintf return successful by returning the number of bytes written in STREAM, but in the actual file the string I put is not there.
From stackoverflow
sasayins
-
The output is probably just buffered. Try closing the file using close() or call fflush() on the stream to force the string to the file.
From Harry -
one thing you haven't mentioned is have you done the flush() on the stream? although it should happen at the moment you're closing the stream.
and the other - you say "in the actual file the string is not there". do you mean you have nothing written in the file, or you have some junk written there? can it be a difference between the ascii and binary stream being used in your case?
From zappan -
yup close() and fflush() is my problem. thanks alot!
From sasayins
0 comments:
Post a Comment