pipes

How do I append onto pipes?

So my question is if I can somehow send data to my program and then send the same data AND its result to another program without having to create a temporary file (in my case ouputdata.txt). Preferably using linux pipes/bash. I currently do the following: cat inputdata.txt | ./MyProg > outputdata.txt cat inputdata.txt outputdata.txt |...

Yahoo pipes - any way to combine items?

I'm working on a pipe and am having trouble with combining two lists of items. List 1: [0] letter - a [1] letter - b [2] letter - c List 2: [1] word - apple [2] word - banana [3] word - cake I'd like something which emits the following: List 3: [1] letter - a word - apple [2] letter - b word - banana [3] letter - c word ...

Simple anonymous pipes - what wrapper model you use? (WinAPI, C++)

I have two running processes in Windows, and each process has a pipe to the other. I want to serialize a complicated class and transmit it from one process to the other. I already have the serialization procedure worked out, and I understand that the pipes are sending binary streams. How should I go about sending my serialized data? I'm...

Linux how do I put double quotes around a file before piping it to tar?

I use ls to obtain my filename which has white space so it looks something like: my file with whitespace.tar.bz2 I want to pipe this to tar similar to: ls | grep mysearchstring | tar xvjf How can I insert double quotes before piping it to tar? ...

What does CreateFile("CONIN$" ..) do?

I was hacking away the source code for plink to make it compatible with unison. If you don't know, unison is a file synchronization tool, it runs an "ssh" command to connect to a remote server, but there's no ssh.exe for windows; there's plink, which is very close but not close enough (it doesn't behave like unison expects it to), so pe...

Read\write boost::binary_oarchive to pipe.

Hello. I am continue to build two simple processes throwing class objects one to another (see my previous post) through simple (anonymous) pipes. Now I revealed for myself boost::serialization (thanks answered people) and have tried to make some class be serialized through ::WriteFile\::ReadFile. So - what I am doing wrong? 1) I creat...

Amazon Web services - retrieving a wishlist

I've been tinkering with Yahoo Pipes and the Amazon E-Commerce Service (ECS) SDK to retrieve my wishlist. The problem is that although I can get all the items on my wishlist just fine, it seems to include items that I've deleted too. Has anyone else used this API and noticed this? Is there a way around it? UPDATE: Requested additiona...

Find out if pipe's read end is currently blocking

I'm trying to find out if a child process is waiting for user input (without parsing its output). Is it possible, in C on Unix, to determine if a pipe's read end currently has a read() call blocking? ...

Detect closed pipe in redirected console output in .NET applications

The .NET Console class and its default TextWriter implementation (available as Console.Out and implicitly in e.g. Console.WriteLine()) does not signal any error when the application is having its output piped to another program, and the other program terminates or closes the pipe before the application has finished. This means that the a...

Broken pipes in C -- pipe(), fork(), exec() program

Hello, I need to write a simple program: There will be a Parent and a few programs [children] (started via execl in Parent). Children communicate to one another in this way: Child I sens to Parent number J, Parent sends a message (something like -- "there is a message to you") to J, J send to Parent number K etc. etc. And there is a pr...

Why doesn't more Java code use PipedInputStream / PipedOutputStream ?

I've "discovered" this idiom recently, and I am wondering if there is something I am missing. I've never seen it used. Nearly all Java code I've worked with "in the wild" favors slurping data into a string or buffer, rather than something like this example (using HttpClient and XML APIs for example): final LSOutput output; // XML st...

How can I open pipes with OO style?

I rewrite my old code in new style, like below: #old style open(FD,"file"); #new style $fh = IO::File->new("file","r"); Files are ok, but I don't know how to open pipes. # read from pipes. open(PIPE,"some_program |"); # write to pipes. open(PIPE,"| some_program"); How to treat pipes in OO Style IO? adding: thanks Jonathan, it's ...

How can you check (peek) STDIN for piped data in Perl without using select?

Hi, I'm trying to handle the possibility that that no arguments and no piped data is passed to a Perl script. I'm assuming that if there are no arguments then input is being piped via STDIN. However if the user provides no arguments and does not pipe anything to the script, it will try to get keyboard input. My objective is to provide a...

Synchronizing reading and writing with synchronous NamedPipes

A Named Pipe Server is created with hPipe = CreateNamedPipe( zPipePath, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_READMODE_BYTE, PIPE_UNLIMITED_INSTANCES, 8192, 8192, NMPWAIT_USE_DEFAULT_WAIT, NULL) Then we immediately call...

How to make a non-blocking pipe from the command-line in Solaris?

I'm trying to write a lua script that reads input from other processes and analyzes it. For this purpose I'm using io.popen and it works as expected in Windows, but on Unix(Solaris) reading from io.popen blocks, so the script just waits there until something comes along instead of returning immediately... As far as I know I can't change...

How does commands-piping work in *NIX?

When I do this: find . -name "pattern" | grep "another-pattern" Are the processes, find and grep, spawned together? My guess is yes. If so, then how does this work?: yes | command_that_prompts_for_confirmations If yes is continuously sending 'y' to stdout and command_that_prompts_for_confirmations reads 'y' whenever it's reading it...

Using pipes in C for parent-child IPC makes program block

I am writing a server which fork()'s off a child process when it accepts a socket connection. As the child communicates with a client, it must send some of that information back to the parent. I am using a pipe to accomplish this. The problem is that when I try to do the parent-child IPC, the parent blocks when reading input from the c...

Is sed blocking?

I had the impression sed wasn't blocking, because when I do say: iostat | sed sed processes the data as it arrives, but when I do iostat | sed | netcat Then sed blocks netcat. Am I right? ...

C# Stream text/data to zip/gpg instead of passing app a filename?

I currently have an app written in C# that can take a file and encrypt it using gpg.exe What I'm trying to do is, instead of 1. Creating a file (from database queries usually) 2. encrypting the file 3. deleting the non-encrypted file I want to Gather info into memory (into a dictionary or a list or whatever) stream the text/d...

Python one-liner to print every file in the current directory

How can I make the following one liner print every file through Python? python -c "import sys;print '>>',sys.argv[1:]" | dir *.* Specifically would like to know how to pipe into a python -c. DOS or Cygwin responses accepted. ...