-
fputs and fprintf
Hallo,
i'm trying to write in a file using the function fputs.
fputs creates the file but does'nt write. The code works on a windows-plattform.
if( (out=fopen(ofile, "a")) != NULL)
{
if(fputs(bufferHelp, out) == EOF)
{
printf("ERROR: could'nt write %s\n", out);
}
}
else
{
printf("ERROR: unable to create %s\n", ofile);
_exit(1);
}
Writing the stream to stdout works. But i can't write in the file out (any filename given by the commandline). I alwys get an empty file, thats all. Fprinf gives the same result.
Thanks a lot for help in advance.
-
If you post your entire code, I might be able to give you a hand.
starX
www.axisoftime.com
-
Thanks
Thanks for your offer.
I found the error. I did'nt close the File.