Err SaveFile (char *filename, void *buffer, int32 bufsize, int32 extrabytes)
If the file doesn't already exist, it is created. If it does exist, its contents is completely replaced by the contents of the specified buffer. When the file is created it is pre-sized to bufsize+extrabytes. If the file exists but needs to be expanded to hold the output, it is expanded to the size needed+extrabytes.
By specifying a non-zero extrabytes parameter you can ensure that the file will grow enough to handle a few more slightly-growing outputs before an expansion has to be done again. This is useful because expanding a file is relatively expensive. If the nature of the data you're saving is that it never grows, use an extrabytes value of zero. Remember that NVRAM is a very limited resource; don't needlessly use large extrabytes values.
LoadFile