[comp.windows.ms.programmer] File I/O Mystery

kam@iti.org (Keith A. McNabb) (06/21/91)

Thanks to everyone on the net who has shortened my Windows programming
learning curve!  Well, here's one more:

I'm writing to a text file using scads of fprintf() calls.  I've 
opened the file using OpenFile(), then obtained the file pointer by
calling fdopen().  The contents of the output file are just fine,
except that it mysteriously limits itself in size to 2048 bytes.

I've bumped up HEAPSIZE, and I've checked to make sure there are no
Windows system calls between the file open and close.  Also, I check
the return from fprintf, and it is always non-zero.

Has anyone run into this?  It's gotta be something simple.

Keith McNabb
kam@iti.org

kam@iti.org (Keith A. McNabb) (06/21/91)

I just answered my own question.  When I added an fflush() call prior
to closing the file, everything worked fine.  Hmmmm.  Well, whatever
works.

Keith
kam@iti.org