On 07/20/2015 09:19 AM, Assaf Gordon wrote:
> 
> However, it's important to remember that coreutils' programs as not
> designed to be
> incorporated into bigger programs. One issue is that all the programs
> terminate
> on any errors - if there was an error in the parameters (or during
> runtime),
> the called function  (e.g. your "echo.main()") will not return to your
> 'main' with an error code - it will terminate your program.
> 
> Alternatively,
> since coreutils is GPL'd, it might be simpler to just reuse to code in
> your project instead of trying to force the programs to work the way you
> want (assuming your project is also GPL'd).

Or use fork()/exec() (or system() or popen() or posix_spawn()...) to
call the coreutils program externally from within your program, rather
than trying to code things directly into your executable.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to