Standard Input & Output
-
Hello All, How can I read from standard input and write to standard output. System.Diagnostics.Process.StandardInput's MSDN reference didn't help as it separately starts the process and then redirects the Standard Input/Output but what If the process is already running and called my Application to feed it some data. Here's an example to make things a bit clear: I am simply using Unix pipes i.e. cat command in cygwin (A Linux like Environment for windows) that basically just reads standard input and print to standard output. following is the command: % cat input/sample.txt | src/csharp/maptest But that doesn't seems to work. Any solutions? Thanks in advance.
AliAmjad(MCP) First make it Run THEN make it Run Fast!
-
Hello All, How can I read from standard input and write to standard output. System.Diagnostics.Process.StandardInput's MSDN reference didn't help as it separately starts the process and then redirects the Standard Input/Output but what If the process is already running and called my Application to feed it some data. Here's an example to make things a bit clear: I am simply using Unix pipes i.e. cat command in cygwin (A Linux like Environment for windows) that basically just reads standard input and print to standard output. following is the command: % cat input/sample.txt | src/csharp/maptest But that doesn't seems to work. Any solutions? Thanks in advance.
AliAmjad(MCP) First make it Run THEN make it Run Fast!
Are you looking for System.Console.In and System.Console.Out ? In .net, detecting redirection and pipes is a little tricky, but I posted some code on my blog -- look under my proile.