By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,258 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,258 IT Pros & Developers. It's quick & easy.

Process StandardInput Limitations ?

P: n/a
Hello,
I'm building a software to interface with an .exe that will parse a
text file (a lex program build in cygwin that works great when it's
executed on it's own).

The OutputXML is more than 150 000 characters and the software always
bugs at the 20479 character, it just seems to hang and nothing happens.
If I try with 20 000 characters it works great.

Is there any size limitation ? If so is there anyway to get passed this
limitation ?

Thank you,

PS : Here is my code :

StreamWriter swx;
StreamReader srx;

p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;

p.StartInfo.FileName = "xmltest.exe";
p.Start();
swx = p.StandardInput;
srx = p.StandardOutput;

swx.AutoFlush = true;
char[] OutputChar = OutputXML.ToCharArray();

for (int i = 0; i < OutputChar.Length; i++)
{
swx.Write(OutputChar[i]);
swx.Flush();
}
swx.WriteLine("");
swx.WriteLine("EOF");

Jun 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello, [ripper]!

r> The OutputXML is more than 150 000 characters and the software always
r> bugs at the 20479 character, it just seems to hang and nothing happens.
r> If I try with 20 000 characters it works great.

r> Is there any size limitation ? If so is there anyway to get passed this
r> limitation ?

how do you fill OutputXml?

StreamWriter supports writing strings,
you can write without loop

swx.Write(OutputXml);

You can test the code with your custom console application, that will call Console.Read(...);
and if it would accept more that 150K symbols then the bug may be in the application that reads from console.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Jun 12 '06 #2

P: n/a
Thank you for your reply Vadym,
Actually I tried with the string first and tought it was too large
that's why I did it in an array.

The xmltest.exe program works great (with the same file) when I use
xmltest.exe < file.xml

Is there anyway to do this in c# ?
Vadym Stetsyak a écrit :
Hello, [ripper]!

r> The OutputXML is more than 150 000 characters and the software always
r> bugs at the 20479 character, it just seems to hang and nothing happens.
r> If I try with 20 000 characters it works great.

r> Is there any size limitation ? If so is there anyway to get passed this
r> limitation ?

how do you fill OutputXml?

StreamWriter supports writing strings,
you can write without loop

swx.Write(OutputXml);

You can test the code with your custom console application, that will call Console.Read(...);
and if it would accept more that 150K symbols then the bug may be in the application that reads from console.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com


Jun 12 '06 #3

P: n/a
Hello, [ripper]!

r> The xmltest.exe program works great (with the same file) when I use
r> xmltest.exe < file.xml

r> Is there anyway to do this in c# ?

Yes, you wrote it in the above message.
What kind of error do you receive?

If application hangs in writing to the stream, maybe this means that xmltest.exe is processing data?.
Have you access to the xmltext.exe sources. If you have to can debug xmltext.exe, and see how it is reading from the input stream...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Jun 12 '06 #4

P: n/a
Yes I have access to the xmltest.exe source, it's a simple lex program
compiled in C (actually it's only ment to echo the characters as a test
until i get it working)

Here is the source :
%{
%}
%%
"EOF"$ return 0;
.. ECHO;
%%
int main(void)
{
yylex();

return 0;
}
Vadym Stetsyak a écrit :
Hello, [ripper]!

r> The xmltest.exe program works great (with the same file) when I use
r> xmltest.exe < file.xml

r> Is there anyway to do this in c# ?

Yes, you wrote it in the above message.
What kind of error do you receive?

If application hangs in writing to the stream, maybe this means that xmltest.exe is processing data?.
Have you access to the xmltext.exe sources. If you have to can debug xmltext.exe, and see how it is reading from the input stream...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com


Jun 12 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.