use the stdio.h file API to access files. you can open a file with
Code:
FILE * f = fopen("filename", "a");


to append data to the end of the file.

also try to prevent single-byte reads and read as much data as possible in a single fread call


Visit my site: www.masterq32.de