[Mono-bugs] [Bug 328162] New: Garbage characters when redirecting standard input to a program...

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 25 09:39:13 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=328162

           Summary: Garbage characters when redirecting standard input to a
                    program...
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: informatique.internet at fiducial.fr
         QAContact: mono-bugs at ximian.com
          Found By: ---


I try to enter some data to an external program using Process.Start()
I've seen that there's some garbage at the beginning of StandardInputStream

To reproduce it:

1. Try this : 

using System;

using System.IO;
using System.Diagnostics;
namespace TestMono
{
        class MainClass
        {

public static void Main(string[] args)
                {
                        string passphrase="EntryTest";
                        Process prcss=new Process();
                        ProcessStartInfo info=new ProcessStartInfo();
                        info.UseShellExecute=false;
                        info.FileName="/home/hubert/test.sh";
                        info.Arguments="-c bla";
                        info.RedirectStandardInput=true;
                        prcss.StartInfo=info;           
                        prcss.Start();
                        prcss.StandardInput.NewLine="\r\n"; 
                        prcss.WaitForInputIdle();

                        prcss.StandardInput.WriteLine(passphrase);
                        prcss.StandardInput.Flush();
                        prcss.WaitForExit();

                }
}

2. Create a test.sh shell program :

#!/bin/sh
echo "key :";
read key;
echo "key entered :$key"

3. Launch monotest.exe


Actual result : (With a ISO8859-15 console)

hubert at hublinux /home/hubert/Projects/TestMono $  ./bin/Debug/TestMono.exe
key :
key entered :EntryTest

Expected Results:
hubert at hublinux /home/hubert/Projects/TestMono $  ./bin/Debug/TestMono.exe
key :
key entered :EntryTest


It works with mono 1.2.5.1 and it fails with trunk


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list