Retrieving last modified node path (Was: [augeas-devel] First tests with aug mv)

David Lutterkort dlutter at redhat.com
Fri Aug 1 21:55:28 UTC 2008


On Fri, 2008-08-01 at 23:19 +0200, Raphaël Pinson wrote:


> OK, so I guess what there is to code now is a set_last_created call,
> and the functions that will guess the path to send it to the
> function :)
> 
> I was telling you earlier that I thought in tree_insert I could
> probably use seg_parent to get the parent node of the PATH given to
> tree_insert, and then go through all the children of this parent node
> until I find the newly inserted tree. Do you confirm this is how to do
> it?

Yeah, that's roughly what needs to happen; at the end of tree_insert,
you'd want to set last_segment(p)->tree to the newly created node and
than call format_path(p) .. I think though that the
aug_set("/augeas/tree/last_created", format_path(p)) should be called
from aug_insert, not tree_insert, since you don't want that node to
change when tree_insert is used internally.

David





More information about the augeas-devel mailing list