pipes

Using pipes inside a class in C++

I'm trying to use this tutorial to make plots with Gnuplot in C++. However I will be using the pipe to Gnuplot from within a class, but then I run into some problems: I've got a header file where I declare all variables etc. I need to declare the pipe-variable here too, but how do I do that? I've tried doing it straight away, but it do...

Java/C++ communication via pipe on Windows

Hi, I have two separate programs, one in Java and one in C++, both running on Windows. We need to do bidirectional interprocess communication between the two. Up until now, we were using this awkward solution of writing to text files and reading them on the other side, where the producer would generate a .lock file when it's done writi...

Pipe implementation

I am trying to implement a linux shell that supports piping. I have already done simple commands, commands running in background, redirections, but piping is still missing. I have already read about it and seen some snippets of code, but still haven't been able to sort out a working solution. What I have so far: int fd[2]; pipe(fd); ...

Pipe data from InputStream to OutputStream in Java

Dear all, I'd like to send a file contained in a ZIP archive unzipped to an external program for further decoding and to read the result back into Java. ZipInputStream zis = new ZipInputStream(new FileInputStream(ZIPPATH)); Process decoder = new ProcessBuilder(DECODER).start(); ??? BufferedReader br = new BufferedReader(new InputStream...

How to send messages between c++ .dll and C# app using named pipe?

I'm making an injected .dll written in C++, and I want to communicate with a C# app using named pipes. Now, I am using the built in System.IO.Pipe .net classes in the C# app, and I'm using the regular functions in C++. I don't have much experience in C++ (Read: This is my first C++ code..), tho I'm experienced in C#. It seems that the...

can't read from stream until child exits?

OK I have a program that creates two pipes -> forks -> the child's stdin and stdout are redirected to one end of each pipe -> the parent is connected to the other ends of the pipes and tries to read the stream associated with the child's output and print it to the screen (and I will also make it write to the input of the child eventually...

Can a PIPE in LINUX ever lose data?

And is there a upper limit on how much data can it contain? ...

Inter Process communication: MFC server, .NET C# client

Hi guys, I have two MFC C++ desktop applications exchanging string commands using named pipes. All good and reliable. Now, I have to add clients that are written in .NET C# using SilverLight controls. I know how to do named pipes in C#. But my first attempt to mix those failed: cannot connect clients to running servers. Is there an...

Difference between piping a file to sh and calling a shell file

This is what was trying to do: $ wget -qO- www.example.com/script.sh | sh which quietly downloads the script and prints it to stdout which is then piped to sh. This unfortunately doesn't quite work, failing to wait for user input at various points, aswell as a few syntax errors. This is what actually works: $ wget -qOscript www.exam...

gzip several files and pipe them into one input

I have this program that takes one argument for the source file and then it parse it. I have several files gzipped that I would like to parse, but since it only takes one input, I'm wondering if there is a way to create one huge file using gzip and then pipe it into the only one input. ...

C check before writing to closed pipe

Is there an easy way to check if a pipe is closed before writing to it in C? I have a child and parent process, and the parent has a pipe to write to the child. However, if the child closes the pipe and the parent tries to read - I get a broken pipe error. So how can I check to make sure I can write to the pipe, so I can handle it as an...

output of one command is argument of another

Is there any way to fit in 1 line using the pipes the following: output of sha1sum $(xpi) | grep -Eow '^[^ ]+' goes instead of 456 sed 's/@version@/456/' input.txt > output.txt ...

Linux C: "Interactive session" with separate read and write named pipes?

Hi all, I am trying to work with "Introduction to Interprocess Communication Using Named Pipes - Full-Duplex Communication Using Named Pipes", http://developers.sun.com/solaris/articles/named_pipes.html#5 ; in particular fd_server.c (included below for reference) Here is my info and compile line: :~$ cat /etc/issue Ubuntu 10.04 LT...

How to send a simple string between two programs using pipes?

I tried searching on the net, but there are hardly any resources. A small example would suffice. EDIT I mean, two different C programs communicating with each other. One program should send "Hi" and the other should receive it. Something like that. ...

Using pipes in Linux with C

Hi, I'm doing a course in Operating Systems and we're supposed to learn how to use pipes to transfer data between processes. We were given this simple piece of code which demonstrates how to use pipes,but I'm having difficulty understanding it. #include <stdio.h> #include <stdlib.h> #include <unistd.h> main() { int pipefd [2],...

How do I output the proper coded link with Yahoo Pipes

This all seems like it should be working to me but my appended "read more" link displays as plain text instead of as a link... Any insight or help on fixing this would be awesome! My pipe can be found at: http://pipes.yahoo.com/pipes/pipe.info?_id=1a22724d01568b8019be3125c7fb3075 ...

Write to pipe deadlocking program

Hi, I am having a problem in my program that uses pipes. What I am doing is using pipes along with fork/exec to send data to another process What I have is something like this: //pipes are created up here if(fork() == 0) //child process { ... execlp(...); } else { ... fprintf(stderr, "Writing to pipe now\n"); write(pipe, ...

Using boost::asio::async_read with stdin?

hi poeple.. short question: I have a realtime-simulation which is running as a backround process and is connected with pipes to the calling pogramm. I want to send commands to that process using stdin to get certain information from it via stdout. Now because it is a real-time process, it has to be a non blocking input. Is boost::asio::a...

Yahoo Pipes 'failed to parse input' XML

Hello, I'm having a slight problem with Yahoo Pipes, when i enter the url: Umstant i get an error 'failed to parse input'. I think the problem is because the XML isn't being transmitted with the xml declaration: <?xml version="1.0" encoding="utf-8"?> I've asked the author to add it but it seems to break other things in the process, s...

How do you pipe output from a Ruby script to 'head' without getting a broken pipe error

I have a simple Ruby script that looks like this require 'csv' while line = STDIN.gets array = CSV.parse_line(line) puts array[2] end But when I try using this script in a Unix pipeline like this, I get 10 lines of output, followed by an error: ruby lib/myscript.rb < data.csv | head 12080450 12080451 12080517 12081046 12081048 ...