473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Process StandardInput Limitations ?

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
4 5257
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ask | last post by:
Hi NG I'm a bit new to programming c# and have a question regarding ftp by the command prompt. As far as I can see it should be possible to start a process and pipe command streams into it. But...
4
by: jam | last post by:
Dear All, I have a command process running xcopy in console, and now I want to execute the program Rsync After the files are copied...how could i do?? Process p10=new Process();...
2
by: O_Spring | last post by:
I am writing a program in c#. I would like to read a binary file to the standard input of a process (it is flac.exe to encode/decode some files). I have tried to use the following code : ...
0
by: Phillip Galey | last post by:
I'm trying to use the Process object to have RUNAS run DOS commands. I have no problem getting the Process object to run DOS commands and return the resulting text back to the program. However,...
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: Al | last post by:
I'm currently attempting to use PLink (the console component of PUTTY - see http://www.chiark.greenend.org.uk/~sgtatham/putty/) as a Telnet component as I may in future need to change to using SSH...
5
by: =?Utf-8?B?Z215ZXJz?= | last post by:
Hello, I am attempting to start a cmd.exe process and pass several .vbs scripts (with additional parameters) and then read the output from the scripts and make "notes" in a DataTable (the...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
1
by: =?Utf-8?B?U3VydHVyWg==?= | last post by:
The following code used to work. It starts up notepad and types a few lines. What am I doing wrong? I'm using VB.NET 2005 under Vista. It starts notepad okay, but it can't 'type' into it. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.