Writing the iff chunk data is done with either the writechunkbytes() or writechunkrecords() functions. error = WriteChunkBytes (iff, buf, size); error = WriteChunkRecords (iff, buf, recsize, numrec); If you specified a valid chunk size when you called pushchunk(), writechunkbytes() and writechunkrecords() will truncate attempts to write past the end of the chunk. Code to write an ilbm file might take the following form: iff = AllocIFF (); iff->iff_Stream = Open ("foo", MODE_NEWFILE); InitIFFasDOS (iff); OpenIFF (iff, IFFF_WRITE); PushChunk (iff, ID_ILBM, ID_FORM, IFFSIZE_UNKNOWN); PushChunk (iff, ID_ILBM, ID_BMHD, sizeof (struct BitMapHeader)); WriteChunkBytes (iff, &bmhd, sizeof (bmhd)); PopChunk (iff); PushChunk (iff, ID_ILBM, ID_CMAP, cmapsize); WriteChunkBytes (iff, cmapdata, cmapsize); PopChunk (iff); PushChunk (iff, ID_ILBM, ID_BODY, IFFSIZE_UNKNOWN); packwritebody (iff); PopChunk (iff); PopChunk (iff); CloseIFF (iff); Close (iff->iff_Stream); FreeIFF (iff); Again, error checking is not present for clarity. See the example code clipftxt.c which writes a simple ftxt clip to the clipboard.