nvram
The SaveDataFile()
function takes a name, a data pointer, and
a size indicator, and creates a file of that name and size, containing the
supplied data.
Writing data to a file requires a bit of finesse. Data can only be written in blocks, not bytes. If the data being written is not a multiple of the target device's blocksize, the last chunk of data must be copied to a buffer which is the size of a block, and the block can then be written.