how to delete a section of the configuration file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to delete a section of the configuration file

belle.shi
hi,
   after read and write the configuration file, i need to delete one section,
but it seems the libconfuse didn't provide any function to do this, is
there anyone who knows how can i delete a section of the configuration
file, thank you

best regards

belle



_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to delete a section of the configuration file

Keith Mendoza

Belle,

It is generally not a good practice for an application to modify a configuration file that it reads. The only reason I personally would use the printing function that confuse provides is for debugging purposes; even then I would still just have the appropriate values be printed out in debug statements.

But to answer your question, the quickest thing I can think of doing this is to simply traverse the cfg_opt_t pointer and not write the section you want to leave out.

Keith

On Sep 16, 2009 11:25 PM, <[hidden email]> wrote:

hi,
 after read and write the configuration file, i need to delete one section,
but it seems the libconfuse didn't provide any function to do this, is there anyone who knows how can i delete a section of the configuration file, thank you

best regards

belle



_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel


_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel