Creating a new ppufile works almost the same as reading one. First you need to init the object and call create:
After that you can simply write all needed entries. You’ll have to take care that you write at least the basic entries for the sections:
Writing an entry is a little different than reading it. You need to first put everything in the entry with ppufile.putxxx:
After putting all the things in the entry you need to call ppufile.writeentry(ibnr:byte) where ibnr is the entry number you’re writing.
At the end of the file you need to call ppufile.writeheader to write the new header to the file. This takes automatically care of the new size of the ppufile. When that is also done you can call ppufile.closefile and dispose the object.
Extra functions/variables available for writing are:
This will give you a clean header or entry. Normally this is called automatically in ppufile.writeentry, so there should be no need to call these methods. You can call
to flush the current buffers to the disk, and you can set
to False if you don’t want the crc to be updated when writing to disk. This is necessary if you write for example the browser data.