run other programm


 
Thread Tools Search this Thread
Top Forums Programming run other programm
# 1  
Old 09-25-2003
run other programm

I have the programm, that says to STDERR(not to STDOUT!): "hello world!" and this programm is compiled and I have no sources.
When I try to open this programm in another using C:
=======================================
FILE *pp = popen("hello_to_stderr.exe", "r");
int c;
string a;
while( (c=getc(pp)!=EOF ) a +=char(c);
=======================================
the "a" string doesn't get anithing! But i see the words
"hello world!" on a screen! It simply outputs the STDERR!
How can I get the STDERR thread?
And how can I make it work on both Linux and MSWindows?
# 2  
Old 09-25-2003
For unix:
popen("hello_to_stderr.exe 2>&1", "r")
should work since the command line is passed to a shell for interpretation.

I don't know if that will work on windows. And I would guess that it would depend onthe compiler or more accurately, the library that comes with the compiler. If you try it on windows, please post back and tell us if it worked and mention which windows os and which compiler you tried.
# 3  
Old 09-29-2003
Yes! It works in windows!
I use "gcc for windows" (I don't remember how have I got it - it was a long time ago) you can find it at my ftp:
http://take-1.biz/dn/gcc.exe - its over 2-3 MB.

windows was XP, but i think it will work even in 95 - download the compiler and start the "bin/jfe.exe" -

And it really works! Thank you!

Last edited by shalmoo; 09-29-2003 at 08:19 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Programm not working on all sample

Hi all I am using following code and input to duplicate entries till next row but out is cutting some words in this sample can anybody check on his system is there any error? awk ' { if($2 !~ /^ *$/) { a=substr($0,length($1)+1,index($0,$NF)-length($NF)); b=$NF; } print $1, a, b } ' file... (1 Reply)
Discussion started by: Priyanka Chopra
1 Replies

2. Shell Programming and Scripting

unix shell programm(need urgent Help)

Hi guys, i am new to shell can u please explain how to get those two outputs in temp1 i have i/p like abcd edk lkg jkl loop i need o/p abcd ********* edk********** lkg *********** jkl *********** loop************ need o/p abcd *************** (2 Replies)
Discussion started by: ashokkrishna063
2 Replies

3. Shell Programming and Scripting

Problem with links programm.

Problem with links programm. Hi! I write sctipt for aytomatic checking into IE stas.html -> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="newdata.submit()"></script> </head> <body... (1 Reply)
Discussion started by: beckss
1 Replies

4. Cybersecurity

Antivirus Programm for Solaris Desktop

Hello, I´m searching a antivirus solution for Solaris Desktop PC´s (Intel). Can anyone tell me more about some producer?? Thanks Volker (6 Replies)
Discussion started by: kingossi
6 Replies

5. Shell Programming and Scripting

how to view html in ksh programm

have a script in ksh called file1 #!/bin/ksh cat my.html --------------------------- and a html file hy.html can u tell me that if i execute "file1" script it will open hy.html bt here it is showing the all the tags along with text......... it should open the browser part... (2 Replies)
Discussion started by: ali560045
2 Replies

6. Shell Programming and Scripting

How to embeded programm within programm

Hi, How to embeded programme within perl programme. Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies

7. Programming

how do i run am encrpyrtic programm on unix

how do i run am encrpyrtic programm on unix, (4 Replies)
Discussion started by: ghoz
4 Replies

8. UNIX for Dummies Questions & Answers

how can i install a programm?

Hello Friends, I have a problem with install.Can u tell me,how can i install a program?I am not a Root.n i use AIX(IBM) system.n how can i access a cdrom?I have been tried it,but didn't work.I can'n mounted(can u tell me another way or Command)? thanks all. (3 Replies)
Discussion started by: Christianto
3 Replies

9. UNIX for Dummies Questions & Answers

How can install a programm?

Hello Friends, I have a problem with install.can u tell me how can I install a programm?I use AIX(IBM) system. And how can i access cd-rom?I can't mounted,coz i am not Root.(can u tell me another Command /way)? Thanks all. (1 Reply)
Discussion started by: Christianto
1 Replies
Login or Register to Ask a Question