[augeas-devel] aug_reset()
David Lutterkort
dlutter at redhat.com
Wed Apr 30 16:54:24 UTC 2008
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 ?
David
More information about the augeas-devel
mailing list