# nvram

Demonstrate how to save files to nvram and other writable devices.

### Synopsis

`nvram`

### Description

Demonstrates how to save data to a file in NVRAM or to any other writable device.

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.

### Associated Files

nvram.c

### Location

examples/Nvram