Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how can i execute a program from a c-program
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
gerni
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2002
Posts: 107
Location: Austria

PostPosted: Thu Jul 25, 2002 1:52 pm    Post subject: how can i execute a program from a c-program Reply with quote

Hi!
Can someone tell me how i can execute (in my case: the ls -command in the bash) from a simple c-program?

thanks for your help!

gernot
Back to top
View user's profile Send private message
fghellar
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 856
Location: Porto Alegre, BR

PostPosted: Thu Jul 25, 2002 5:15 pm    Post subject: Reply with quote

http://www.cs.cf.ac.uk/Dave/C/node22.html
http://www.cs.cf.ac.uk/Dave/C/
_________________
| www.gentoo.org | www.tldp.org | www.google.com |
Back to top
View user's profile Send private message
gerni
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2002
Posts: 107
Location: Austria

PostPosted: Fri Jul 26, 2002 2:55 pm    Post subject: Reply with quote

thanks for your help! :)
Back to top
View user's profile Send private message
matafan
n00b
n00b


Joined: 22 Apr 2002
Posts: 3
Location: France - Grenoble

PostPosted: Tue Jul 30, 2002 3:46 pm    Post subject: Reply with quote

I guess you'd like to read the command's output... Look at the popen() function, it's the simplest way to achieve this: http://www.gnu.org/manual/glibc-2.2.5/html_node/Pipe-to-a-Subprocess.html#Pipe%20to%20a%20Subprocess
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum