Connecting Tech Pros Worldwide Forums | Help | Site Map

Please tell me ... similar commands of system()

Newbie
 
Join Date: Oct 2007
Posts: 17
#1: Nov 27 '07
Hi,

My task is to design one program in c-language, and my collegue's is another program to design and do some other functionality. I need to execute my collegue's program with out directly copying the code.

So, I am using system() command to execute his program which is working fine but, I need to use some of the intermediate values of my collegue's program but system command is returning only success or failure.

please tell me is there any commands similar to the system and which I can use the intermediate values of one program into another.

I stuck in the middle of my project could any please help me with your expertise...

Thanks & Regards,

Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,366
#2: Nov 27 '07

re: Please tell me ... similar commands of system()


Is this Windows? You might look up CreateProcess().
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,258
#3: Nov 28 '07

re: Please tell me ... similar commands of system()


Quote:

Originally Posted by madhu542

Hi,

My task is to design one program in c-language, and my collegue's is another program to design and do some other functionality. I need to execute my collegue's program with out directly copying the code.

So, I am using system() command to execute his program which is working fine but, I need to use some of the intermediate values of my collegue's program but system command is returning only success or failure.

please tell me is there any commands similar to the system and which I can use the intermediate values of one program into another.

I stuck in the middle of my project could any please help me with your expertise...

Thanks & Regards,

Is your clooeague's module outputting something?
If so then you can re-direct those values to a file and read it after the execution of the system() call.
Raghuram
Newbie
 
Join Date: Nov 2007
Posts: 2
#4: Nov 28 '07

re: Please tell me ... similar commands of system()


Assume ur Module is X,ur colegues module us Y
let his module run as a seprate process, and urs also a seprate process,
if you are depend on his outputs, you create, ur process does ur work and go for a sleep for some time

when the module Y finishes its processing, let that process write into a pipe (by using pipe () ), u can use a signal on this pipe in such a way that when ever some thing is avilable on this pipe the signal will invokie u from sleep

or u can do a blocked read

Quote:

Originally Posted by madhu542

Hi,

My task is to design one program in c-language, and my collegue's is another program to design and do some other functionality. I need to execute my collegue's program with out directly copying the code.

So, I am using system() command to execute his program which is working fine but, I need to use some of the intermediate values of my collegue's program but system command is returning only success or failure.

please tell me is there any commands similar to the system and which I can use the intermediate values of one program into another.

I stuck in the middle of my project could any please help me with your expertise...

Thanks & Regards,

Reply