cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
How to use execl() to include linux comm
How to use execl() to include linux command in a C program?
Apr 18, 2009 at 7:19am UTC
davidsea5
(8)
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!
Apr 18, 2009 at 5:53pm UTC
PanGalactic
(1658)
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?
Apr 22, 2009 at 3:29pm UTC
Nax0r
(1)
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.