[augeas-devel] Create file from scratch

Francis Giraldeau francis.giraldeau at usherbrooke.ca
Sat May 22 12:27:55 UTC 2010


Hi,

I tried to create a file from scratch. While it works while setting a
value of a node, it seems that if the node doesn't have a value, we
can't add it from an empty tree. 

  (* lens with key-value : set creates the node, everything ok *)
  let y = [ key /[a-c]/ . store /[0-9]/]* 
  test y put "" after set "/c" "3" = "c3"

  (* lens without value, can't create the key *)
  let x = [ key /[a-c]/ ]*               
  test x put "" after insa "a" "/" = ""
  test x put "" after set "/a" "foo" = *

I think that rising an error on set when the actual node doesn't have a
value is correct. But, insa should match the empty tree in some way,
isnt't?

Francis




More information about the augeas-devel mailing list