linux registry (no, not that again!)
Jonathan Andrews
jon at jonshouse.co.uk
Wed Jul 28 17:06:52 UTC 2004
On Wed, 2004-07-28 at 17:56, Neal D. Becker wrote:
> Neal D. Becker wrote:
>
> > Yes, here's the linux registry topic again. This project looks
> > interesting. Any comments?
> >
> > http://registry.sourceforge.net/
> >
> >
>
> One motivation that I didn't hear anyone mention:
>
> It is difficult to add entries/edit a flat file.
^^^Bingo !!! Somebody else hits the nail on the head
Hence the need for "A COMMON API FOR MANIPULATING TEXT IN FLAT FILES"
I've written a utility in plain'Ol C. Its got two functions for reading
and writing flat file config files and a utility that uses them. I'm not
suggesting this become a standard, but something like it should exist in
the core libs??
This is the same type of code I see done over and over again because its
missing from the core API for Unix.
My util....
********
[root at localhost onsight-utils]# readwriteconfig
readwriteconfig -r filename variable
readwriteconfig -w filename variable=value
Examples:
readwriteconfig -w /etc/sysconfig/networking/profiles/default/ifcfg-eth0 IPADDR=192.168.1.113
Writing will return a single character A=appended C=Changed N=File to large.
Reading will return the variables value only or nothing if the string is not found
[root at localhost onsight-utils]#
More information about the fedora-devel-list
mailing list