>> executing out-of-process tools and parsing their output is not acceptable in libraries. Ever
> I strongly disagree with this statement. Doing work out-of-process gives robustness (and sometimes security) guarantees that are just not possible with calls into libraries.
But then you rely on parsing tool's output - worst thing to rely ever. This is not to mention that you rely on ability to start an external program - that is, you make *a lot* of assumptions (about filesystems mounted and their layout, etc).
libabc: a demonstration library for kernel developers
Posted Nov 3, 2011 21:54 UTC (Thu) by nix (subscriber, #2304)
[Link]
It's quite all right to rely on parsing a tool's output if you control the tool as well. (Although in this case you should probably provide a library interface to it as well as one that requires exec()ing something, this is not always practical nor possible.)