If the write process has to be interrupted for some reason (it takes too long) before the fsysCloseImage() function is called, then the fileRelease(0) function has to be called. When returning to the function (and completing the writing of the File System), we will continue with the fsysPutByteImage(c) function calls until the whole File System Image has been written.
included "fsee.h" void writeImage(void) { BYTE c; //Prepare the File System to receive a new Image - all data is overwritten! It is //assigned handle 0 fsysOpenImage(); while (1) { //Get next byte of File System Image c = .... //Write a byte to the File System Image file fsysPutByteImage(c); //If finished writing File System Image, break if (...) break; } //Finished writing new File System Image fsysCloseImage(); }