<div dir="ltr"><div>Hi Štěpán,</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 2, 2018 at 8:45 AM, Štěpán Balážik <span dir="ltr"><<a href="mailto:stepan.balazik@nic.cz" target="_blank">stepan.balazik@nic.cz</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">Now, when I want to create similar <i>programmatically </i>using
      <tt>augtool</tt> I run into this:
    <p><tt>$ augtool<br>
        augtool> set tmp/test2.min/file<br>
        augtool> save<br>
        error: Failed to execute command<br>
        saving failed (run 'errors' for details)<br>
        augtool> errors<br>
        Error in /tmp/test2.min:1.0 (parse_skel_failed)<br>
          Input string does not match at all<br>
          Lens: /usr/share/augeas/lenses/<wbr>minimal.aug:8.10-.142:<br>
      </tt></p>
    <p>When I was trying to create empty (or almost empty) file like
      this one using the lenses distributed with Augeas (the one for
      /etc/hosts for example) I ran to no such problems so I suppose I
      am doing something wrong.</p></div></blockquote><div><br></div><div>The problem you are running into is that Augeas parses the original file right before it saves changes; that is necessary to recover things that are in the file but not in the tree, like whitespace. Your lens does not accept an empty file, it  requires that a file contains, at a minimum, "BEGIN\nEND\n". If you change your lens to accept an empty file (e.g., by putting a '?' at the end of your definition of lns), all should be well.</div><div><br></div><div>David</div><div><br></div></div></div></div>