LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   NVram replacement (https://www.linuxquestions.org/questions/programming-9/nvram-replacement-546254/)

knobby67 04-15-2007 01:11 PM

NVram replacement
 
Hi, I normally programme embedded systems so my variables are saved on in battery backed NVram using a memory map. I've now moved on to these new fangled PC's without memory mapped NVRam. So I'm trying to work out the best way to save data. As far as I can see writting to text/bianry file is the way to do it, but I'm sure someone must have a better way to do it. Thanks in advance if anyone can help me out.

w7hd 04-15-2007 09:33 PM

Have you thought about using a USB stick/device for the file storage? Or possibly a memory card, such as one would use for an MP3 player? They have the advantage of being inexpensive and easy to program.

LaughingBoy 04-16-2007 01:39 AM

Quote:

Originally Posted by knobby67
Hi, I normally programme embedded systems so my variables are saved on in battery backed NVram using a memory map. I've now moved on to these new fangled PC's without memory mapped NVRam. So I'm trying to work out the best way to save data. As far as I can see writting to text/bianry file is the way to do it, but I'm sure someone must have a better way to do it. Thanks in advance if anyone can help me out.

To save your program variables, it's quite common to use ini / conf files, in either the system wide location (/etc), or in the user's home directory for a per-user experience (~/.program_name).

Similarly, if there are a number of groups of settings that should / can be saved, then creating a directory in the user's home directory (~/.program_name/) and saving to text files in there, is often used. (ie: ~/.program_name/settings1.conf, and ~/.program_name/settings2.conf). If the settings are to be global to the system, then saving them to the system-wide location (/etc/program_name/) in a few files can also work well.

Under Windows, they can mix this approach with the registry for saving settings too.

HTH,

LaughingBoy.


All times are GMT -5. The time now is 12:13 AM.