Computer Science Canada Return the output of a program |
| Author: | aldreneo [ Tue May 02, 2006 9:58 pm ] |
| Post subject: | Return the output of a program |
Is it possible to return the output of a program with sys? |
|
| Author: | Delos [ Tue May 02, 2006 10:26 pm ] |
| Post subject: | |
Hi. Rats live on no evil star. Now, please be more specific in what you're asking. Questions like yours are vague and unfulfilling. They will get no useful answers. None whatsoever. What do you mean "the output". What do you mean by "sys"? Are you referring to Sys.Nargs() perhaps? If you have specific code associated with this question, please either attach it or post it using [code] tags. |
|
| Author: | aldreneo [ Wed May 03, 2006 4:01 pm ] | ||||
| Post subject: | |||||
Ok.... How do I make it:
So that whatever program that is run it returns the output of the program into the string? such as
|
|||||
| Author: | GlobeTrotter [ Wed May 03, 2006 4:17 pm ] |
| Post subject: | |
I'm pretty sure that that is not directly possible. You can probably do a workaround though. There are system calls that write to a file, right? So write that system call to a file and then use turing to open up the file it creates. |
|
| Author: | Tony [ Wed May 03, 2006 4:21 pm ] |
| Post subject: | |
ok, so you want to read stdout of another program? I don't think that's something that Turing does. Sys.Exec sends out a request to execute a command. Your best bet is to ether pass a parameter to the program to output to a file instead (so you can read the file) or have it piped to a C or Java program that would save output to file. |
|
| Author: | codemage [ Thu May 04, 2006 8:05 am ] |
| Post subject: | |
Heh. Rats. That's clever. Stressed? No tips? Spit on desserts! |
|