[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdin/stdout/stderr problem in g++ and rails

From: Ulrich Windl
Subject: Re: stdin/stdout/stderr problem in g++ and rails
Date: Wed, 08 Dec 2010 15:42:25 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Silver Spoon <> writes:

> In my rails controller, I am doing the following :
> @output = `g++ j.cpp -o "prog" && ./prog`
> This gives the output in the @output variable which i can display in
> my view. But the above works only if the j.cpp is correct and doesn't
> expect any user input. How can I use the stdin/stderr and stdout
> streams here so that :
> If the user has to give input, I open a dialog box on the view with a
> textfield where he/she can enter the input, and the program continues
> to execute.
> If there are any errors in the file, then I should be able to get the
> errors and display them to the user.
> I tried doing this :
> @output = `g++ j.cpp -o "prog" && ./prog| tee prog`
> This allows me to enter the user input at the server command prompt
> (the server log...i don't know what do we call it), but I want it to
> be entered in a textfield in the view. Help me.

Wrong newsgroup, try "man perlipc"...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]