Search code examples
augeas

Is It Possible To Use Augeas For File Conversion?


I recently stumbled upon a tool called Augeas. As far as I understand the tool can be used to create an abstract file type independent tree that can be manipulated where the lens is an intermediary.

I want to try to use it for file conversion. Is that possible? Say, I want to convert yaml into xml. How would I do that?

A simple example of such conversion using augtool would be nice.


Solution

  • Augeas can theoretically be used for file conversion, although it is not its primary goal.

    This will mean manipulating the Augeas tree (typically using aug_cp) to create a new tree from the existing one. When it comes to exporting as XML, Augeas also has a aug_to_xml call which exports any Augeas tree into an XML document.

    Now when it comes to your specific need though, there is no YAML Augeas lens (because it is currently not possible to write one).