LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2007, 01:11 PM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Rep: Reputation: 43
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.
 
Old 04-15-2007, 09:33 PM   #2
w7hd
Member
 
Registered: Aug 2004
Location: Tucson, AZ
Distribution: Ubuntu 9.04 & 10.10, RHEL 4 & 5
Posts: 48
Blog Entries: 3

Rep: Reputation: 16
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.
 
Old 04-16-2007, 01:39 AM   #3
LaughingBoy
Member
 
Registered: May 2006
Location: Adelaide, South Australia
Distribution: Fedora 6-17 x64 / Ubuntu 10.x x64
Posts: 95

Rep: Reputation: 16
Lightbulb

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.

Last edited by LaughingBoy; 04-16-2007 at 01:41 AM.
 
  


Reply

Tags
conf, help, programming



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't load the nvram module LiquidSlumber Linux - Software 2 07-08-2006 12:46 AM
Permissions with tpb, /dev/nvram jrdioko Linux - Software 0 09-30-2005 11:29 PM
replacement for x sneak General 2 07-05-2004 08:10 AM
o/s replacement... GT I.N.C Linux - General 7 07-06-2002 08:42 AM
Win98 Replacement akaize Linux - Networking 3 11-23-2001 02:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration