C
Chicken McNuggets
Hi,
So I am aware of the exec family of functions and the system function to
execute external commands but they do not seem to offer the
functionality to allow me to get the output of said executable so I can
use it in the rest of my program. For instance a simple example would be
to use the "ls" command. I would want to get the output of the directory
listing and be able to manipulate it later on in my program.
Is there an easy way to do this? I realise that this is technically not
standard C and is most likely a POSIX extension but it would be nice if
someone could offer some advice.
Thanks.
So I am aware of the exec family of functions and the system function to
execute external commands but they do not seem to offer the
functionality to allow me to get the output of said executable so I can
use it in the rest of my program. For instance a simple example would be
to use the "ls" command. I would want to get the output of the directory
listing and be able to manipulate it later on in my program.
Is there an easy way to do this? I realise that this is technically not
standard C and is most likely a POSIX extension but it would be nice if
someone could offer some advice.
Thanks.