On 27/02/12 06:50, zzs wrote:
> My config file format just like xorg.aug
> Readind config files all ok.
> Modify some fields then write ok too.
> 
> But I wonder :
> 
> 1. Can I create a new config file and save it to disk using augtool or c
>    code?
>    If yes, Howto do it,

If the new config file is in the autoloaded file list in the lens, then
just by setting the node in Augeas, it'll create the file.  For example:

$ ls etc/securetty
ls: cannot access etc/securetty: No such file or directory
$ augtool -r . -s set /files/etc/securetty/01 tty1
Saved 1 file(s)
$ cat etc/securetty
tty1

> 2. How can I create new node(e.g. a section like in xorg.conf) and let
>    augeas known use which lense to manage it

You can change the /augeas tree to load files with a particular lens:
http://augeas.net/page/Loading_specific_files

Raphael has a useful "augload" utility that sets this up too:
https://github.com/raphink/augeas-sandbox/blob/master/augload

Regards,

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113

_______________________________________________
augeas-devel mailing list
augeas-devel@redhat.com
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to