[yast-devel] manipulating multi-section configuration files
I have a configuration file with sections to it, an example of it is something like this: <snippet of configuration file> [rc5-72] fetch-workunit-threshold=0 fetch-time-threshold=0 [ogr_p2] fetch-workunit-threshold=0 fetch-time-threshold=24 preferred-blocksize=0 [triggers] restart-on-config-file-change=yes pause-on-no-mains-power=yes [display] progress-indicator=auto-sense detached=no [processor-usage] priority=0 max-threads=-1 </snippet> and want to know if it's possible to read and write the individual sections, especially where there are options with the same names in different sections. If it is possible, are there any examples available to work with? Using the simple example at: URL:http://en.opensuse.org/YaST/Tutorials/QuickModule I was able to read and write a straight forward configuration file, but this creates invalid files where there are multiple sections. I just need to figure out how to figure out how to modify the individual parts of the file. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.6 | RISC OS 3.11 -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Hi David, On st 21. ledna 2009, David Bolt wrote:
I have a configuration file with sections to it, an example of it is something like this:
... I was able to read and write a straight forward configuration file, but this creates invalid files where there are multiple sections. I just need to figure out how to figure out how to modify the individual parts of the file.
try reading ini-agent description, there's a part about multiple sections. The documentation is part of your yast2-core-devel package: /usr/share/doc/packages/yast2-core/agent-ini/ini.html As examples, look into the scr files installed on your system under /usr/share/YaST2/scrconf Jiri -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
David Bolt
-
Jiří Suchomel