How to use execl() to include linux command in a C program?

I tried to write a program which includes the execl function
how can I do that?
for example, what should I do if I want to include this command in my C program?
stat -c%y fileName
Thanks!
execl doesn't "include the command in your C program" -- it replaces your program process with a new one.

Why not just call stat(2) directly?
you can use 'system( )' call for ease if you use gcc.

Include the header stdlib.h

system("command");

-man for more
Topic archived. No new replies allowed.