did you try to use fputs?