I hava a Java programm that communicates with a C# console app through a pipe.
In my dev environment it works like a charm but I am wondering if this is still reliable if the java app is running work days and weeks (It's for a POS Terminal).
What I basically do is: write one line -> read one line.
The C# Code is pretty simple
static v...
We have a client that sends requests to a per-call WCF service (WAS hosted, NP binding, same machine) in a loop. The WCF service calls an external EXE to process requests.
The operations on the service can take a few seconds, or a few hours. To combat this, we have sendTimeout=00:01:00, receiveTimeout=00:05:00 and a built-in circuit-b...
Hello,
I am trying to write a GUI program for a command line program in Win32 using WinAPI (so please no MFC). In my current attempt, I am creating an input pipe and an output pipe to read/write data. However, my problem comes in when I attempt to continuously read from a program or to simply write after a single read due to the way I h...
I have been doing a lot of searching and still can't seem to figure out how to fix my issue. I am writing a GUI program (in WinAPI so no MFC please) to communicate with another program (command line based). I am using anonymous pipes since everything is local (but perhaps named pipes would be better?) which then I use CreateProcess(); to...
Ok, I have asked a few questions about different facets of trying to accomplish what I want to do. This time I'm having big issues just reading from a named pipe. I think I have harvested enough information to possibly complete the project I am working on if I can set this up properly. I will include all relevant code below, but my missi...
So I keep bouncing between named and anonymous pipes and here is my issue. I tried named pipes and they just didn't seem to work properly for what I wanted, so I'm back to anonymous pipes. However, the anonymous pipe needs to read input from a pipe (to a program that I did not create) and continuously read it as more information is avail...
Is there a filehandle/handle for the output of a system command I execute in Perl?
...
I am creating an application which will read the output from another application (which I did not write) which sends its output to a command prompt. I need to be able to write this information an "Edit" dialog within my GUI program. I have accomplished this using anonymous pipes and multi-threading (a worker thread for writing and anothe...
Hi!
I'm trying to make two processes communicate using a pipe.
I did this in the parent process:
process = subprocess.Popen(test, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
process.stdin.write("4\n");
output = process.stdout.read()
print output
and in the child process:
inp = raw_input()
integer = int(inp)
print int...
Hello,
I'm trying to add a Sokoban solver (written in C++) to my program in C# (I have got a class in my program that handles marshalling of C++ interface). My program loads solver.dll library which loads solver.exe. Solver.dll and Solver.exe communicate via pipes.
The problem is that when I run my program in Visual Studio (debugging) ...
Hi,
In the subprocess documentation, I haven't found any hint if the pipes created by PIPE are blocking or non-blocking.
I.e., if I call p.stdout.read(), will it block in certain circumstances? The documentation warns about that. How can I avoid that?
Using p.communicate() is not an option for me because I don't want to block/wait unt...
I am planning to write an object-oriented shell (based on Python). I have many ideas already. But before I am going to implement it, I want to inspire me by some existing shell.
What I basically mean by object-oriented:
Parameters are not just an array of strings but an array of objects.
The return value is also an object.
There is no...
Hello,
I have been stuck on this for some time.
Let's say I have a C program like the following. I want to be able to send this program some string and get the control after that.
If I do:
--> cat myfile | myprogram
or
--> echo "0123" | myprogram
or
--> myprogram < myfile
I get the ouput (myfile contains "0123")
30 31 32 33
Usi...
Hi !
What I'ld like to do is similar to what VS does in its output window or other editors in their tool windows: Start another process B from my process A and capture its stdout/stderr output.
So far, I got it working with CreatePipe(), but for some reason, the output of B doesn't arrive at B right when it gets written. It behaves mor...
This seems to be a fairly common thing to do, and I've managed to teach myself everything that I need to make it work, except that I now have a single problem, which is defying my troubleshooting.
int nonBlockingPOpen(char *const argv[]){
int inpipe;
pid_t pid;
/* open both ends of pipe nonblockingly */
pid = fork();
...
I'm trying to search for a certain string in a lot of gziped csv files, the string is located at the first row and my thought was to get the first row of each file by combining find, zcat and head. But I can't get them to work together.
$find . -name "*.gz" -print | xargs zcat -f | head -1
20051114083300,1070074.00,0.00000000
xargs: zca...
I've got a little C server that needs to accept a connection and fork a child process. I need the stderr of the child process to go to an already existing named pipe, the stdout of the child to go to the stdout of the parent, and the stdin of the child tp come from the same place as the stdin of the parent.
My initial attempts involved...
I have two questions is one here.
On Windows, I am familiar with pipes and how they work. However, I am curious as to what mechanism the OS uses to notify the recipient thread of a message arrival.
Does the thread "poll & sleep" continuously for data? Does the OS check to see if the thread is sleeping and wake it up? Or is there some o...
I'm using popen to open a write pipe and send commands to an application. The problem is that the commands are only sent to the application when I close the pipe.
FILE * fp = open(target_app, "w");
fwrite(command, 1, command.size(), fp);
getchar(); //wait for a key, because I don't want to terminate the application
pclose(fp); // at thi...
There are two really simple ways to let one program send a stream of data to another:
Unix pipe, or TCP socket, or something like that. This requires constant attention by consumer program, or producer program will block. Even increasing buffers their typically tiny defaults, it's still a huge problem.
Plain files - producer program ap...