473,806 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Cre ateNoWindow = true;
p.StartInfo.Red irectStandardIn put = true;
p.StartInfo.Red irectStandardOu tput = true;
p.StartInfo.Use ShellExecute = false;

p.StartInfo.Fil eName = "xmltest.ex e";
p.Start();
swx = p.StandardInput ;
srx = p.StandardOutpu t;

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

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

Jun 12 '06 #1
4 5289
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(Outpu tXml);

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(Outpu tXml);

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
3675
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 I cant make it work, it always stalls when I try to read the output: /// code 1 Process ftpProcess = new Process();
4
5950
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(); p10.StartInfo.FileName = "cmd.exe"; p10.StartInfo.UseShellExecute = false; // p.StartInfo.CreateNoWindow = true; p10.StartInfo.RedirectStandardInput = true;
2
4388
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 : StandardInputWriter = convertProcess.StandardInput; byteRead = SourceFileStream.Read(buff,0,BUFFER_LENGTH);
0
4211
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, if I'm using RUNAS (e.g. in order to move files to a protected network share), I run into the problem that RUNAS requires a two-step process to get it started. If you're calling RUNAS from the command prompt, after entering the command line text...
1
5999
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 am executing the find.exe program. The application works perfectly in the development environment. As soon as I execute the compiled program and start the find process I get an "Application Error". The error states that the instruction...
2
8636
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 and this seems an ideal solution. I'm running it as a process and re-directing the standardinput/output/error However, despite working through all the different variations of code I can either think of or find I am unable to achieve true...
5
3459
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 "notes" not being the issue). Beginning with... Dim objProcess As Process Dim objProcessStartInfo As New ProcessStartInfo
11
11964
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 example, does not seem to process any I/O through the Process object. I know that in the case of PowerShell there are better ways to "wrap" the console by directly interfacing with the assemblies of System.Management.Automation or some similarly...
1
4245
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. 'demonstrate "typing" into notepad Dim psiProcessStartInfo As New ProcessStartInfo With psiProcessStartInfo .Arguments = "" 'command line arguments .CreateNoWindow = False
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.