Home made cellphone project.


One last thing..

So far, this is like trying to open the crate that encloses the crowbar you need to open the crate.  If all your information is stored in the blockFile. How do you know what your block IDs are?

The FIRST ID passed back from a blockFile object, is saved as its rootID. You can ask for the rootID and it’ll pass it back to you. The trick is to save, under this ID, the information necessary to decode the rest of your file.


Databases need file tools.

People draw databases like this.

The LC_blockFile library enables you create a blockFile object that manages a file like it was a gigantic heap of RAM.

The blockFile object associates itself to a single file on your SD card. You create a blockFile object with a fullpath to a file that you either want created, or has already been created.

You can ask your blockFile object for a new file ID and, using that ID, save a block of data in its file. You can do this for as many blocks of data you like. Your blockFile object stores and manages of all your data blocks in its file.

To retrieve a block, just pass back the ID for you data, and your blockFile object will return how large that stored block is. Then, after you’ve allocated enough memory to hold it, using that same ID you can retrieve your data.

You can manipulate your data as you see fit. Maybe just change a few things, make it larger, smaller, whatever. Just pass it back with its new size & block ID. Your blockFile object will squirrel it away for you ‘till you need it again.

Or you can just tell your blockFile object to delete the ID. It’ll takes care of that as well.