<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Aug 1, 2008 at 11:10 PM, David Lutterkort <span dir="ltr"><<a href="mailto:dlutter@redhat.com">dlutter@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Fri, 2008-08-01 at 21:56 +0200, Raphaël Pinson wrote:<br>
<br>
<br>
> Or to have both last_modified_node and last_created_node.<br>
> last_modified_node would would refer to the input PATH in the cases of<br>
> aug_set, aug_mv, aug_rm... last_created_node would refer to the exact<br>
> PATH of the last created node. Is it possible for a command to create<br>
> more than one node in a go (I don't see how it would happen)?<br>
><br>
><br>
> So there would be something like<br>
><br>
><br>
>   Previous call    m (the modfied path)   ;    c (the created path)<br>
>        aug_init     - NULL; NULL<br>
>        aug_get      - no influence on value<br>
> of /augeas/tree/last_modified; no influence on value<br>
>        of /augeas/tree/last_created<br>
>        aug_set      - PATH passed to aug_set, fully qualified ;<br>
> resulting PATH, only if the path was created<br>
>        aug_insert   - fully qualified path to newly created node (or<br>
> empty - nothing was _modified_ so to say?) ; fully qualified path to<br>
> newly created node<br>
>        aug_rm       - PATH passed to aug_rm ; NULL<br>
>        aug_mv       - PATH passed to aug_mv as DST argument ; PATH,<br>
> only if the path was created<br>
>        aug_match    - no influence on value<br>
> of /augeas/tree/last_modified ; no influence on value<br>
> of /augeas/tree/last_created<br>
>        aug_save     - either leave /augeas/tree/last_modified<br>
> unchanged or set to NULL ; either leave /augeas/tree/last_created<br>
> unchanged or set to NULL<br>
>        aug_print    - no influence on value<br>
> of /augeas/tree/last_modified ; no influence on value<br>
> of /augeas/tree/last_created<br>
><br>
><br>
> Perhaps that makes the whole thing a bit too complicated though...<br>
<br>
</div></div>I think so ... I'd much rather stick with a last_created node;<br>
last_modified doesn't add anything the caller doesn't know already.<br>
<br>
The calls that might set something in last_created (aug_set, aug_mv,<br>
aug_insert) should probably also set last_created to NULL if they didn't<br>
create anything. Seems like the cleanest solution to me.<br>
<font color="#888888"></font></blockquote><div><br><br>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 :)<br><br>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?<br>
<br>How do I get the path after I've done this? Is format_path(found_seg) correct?<br><br><br><br>Raphael<br><br><br><br><br></div></div></div>