Run a Ms-dos program and catch the output

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mariolopes
Forum Contributor
Posts: 102
Joined: Sun May 22, 2005 7:08 am

Run a Ms-dos program and catch the output

Post by mariolopes »

Hi
I need to run a ms-dos program (made in vc++, vs 2008, console mode) and catch the output. For instance if my program returns the 2 times a number i want my php page runs the program, send one value and verifies if the output is correct. I heard about procopen() function but I don't know much about it.
Any help?
Thank you
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Run a Ms-dos program and catch the output

Post by Weirdan »

Use execution operator: http://us2.php.net/manual/en/language.o ... cution.php

btw, console applications != dos applications.
mariolopes
Forum Contributor
Posts: 102
Joined: Sun May 22, 2005 7:08 am

Re: Run a Ms-dos program and catch the output

Post by mariolopes »

Thank you weirdam
I'll try it, but I think I need procopen because I want to use cin to read values into my program
I'm right?
Post Reply