[augeas-devel] aug_reset()

Harald Hoyer harald at redhat.com
Wed Apr 30 16:59:50 UTC 2008


David Lutterkort wrote:
> On Wed, 2008-04-30 at 17:09 +0200, Harald Hoyer wrote:
>> I can aug_get() and aug_set() and when I am finished aug_save(). Is
>> there a possibility to undo aug_set() like 
>> a aug_reset() which would reread the config and reset to the original
>> state?
> 
> There should be (and some protection against files that are modified
> between when they are read in and when they are saved)
> 
> How about this API call:
> 
>         int aug_reset(augeas *aug, const char *path)
>         
> where PATH must match exactly one node in the tree, and that must
> correspond to a file. Return 0 on success, -1 on failure.
> 
> For example, you could call reset on "/files/etc/hosts" to
> reread /etc/hosts, but calling reset on any node underneath
> "/files/etc/hosts" would be an error. Should resetting "/files/etc" or
> even "/files" be allowed ?

Hmm... I think specific files is enough for the beginning.
An all reset can easily be made by aug_init().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080430/88df21f6/attachment.bin>


More information about the augeas-devel mailing list