pipes

How can I make a hidden, disposable console application and communicate with it?

I've written a small console application to wrap a third-party DLL that has issues. I am calling it from a GUI application using _popen, and just want to read a value from the console program's standard output. In doing so, an undesirable console window is briefly displayed. I am aware that this can be avoided by using a certain STARTUP...

WCF Communication though named pipes with non .net App

I hear that WCF is the new standard for communication across the network and applications in .net. The idea seems to make sense as well, provide standard interfaces for programs to communicate. Here is my situation, I have a .net app i want to communicate to a ruby application though pipes. On the .net side (server) I would like to use ...

Detect if stdin is a terminal or pipe in C/C++/Qt?

When I execute "python" from the terminal with no arguments it brings up the Python interactive shell. When I execute "cat | python" from the terminal it doesn't launch the interactive mode. Somehow, without getting any input, it has detected that it is connected to a pipe. How would I do a similar detection in C or C++ or Qt? ...

Regulate image sizes in Yahoo Pipes output

When combining multiple blog feeds into one using Yahoo Pipes, is it possible to control the image sizes in the output? I've seen the existing operators and filters offered, but there doesn't seem to be an option that e.g. rejects a post from my feed if its image is >500px wide, or even resizes that image to a given size. ...

Allowing pipe to read fragmented messages

How can I protect against fragmented messages being sent through a named pipe. Is it as simple as a while loop checking for an error or disconnect.... or is there more to it? (using winapi, named pipes in C) Thanks. ...

Buffering filtering pipe on Linux

I commonly build up long, multi-command pipes on Linux/Unix to process large text files (sed | grep | sort | less , etc.). I would like to be able to use a pipeline element that would buffer everything received via stdin until a key phrase/string is detected (e.g. "SUCCESS"), at which point it releases everything received up to that poi...

Broken pipes and tee?

The output of this echo is not passed on to the next command using pipe. echo 'set foreign_key_checks = 0; truncate table saurabh.bus_services;' | mysqldump --compact --no-create-info -h192.168.950.180 -uroot -p live pnlbus | more I want the set and truncate commands followed by the dump output. ...

Trick an application into thinking its stdin is interactive, not a pipe

I'm trying to do the opposite of http://stackoverflow.com/questions/1312922/detect-if-stdin-is-a-terminal-or-pipe-in-c-c-qt I'm running an application that's changing its output format because it detects a pipe on stdout, and I want it to think that it's an interactive terminal so that I get the same output when redirecting. I was thi...

Sending data between Java to c++ on windows?

Hi friends, I want to send the raw audio buffer to c++ for audio transcoding. I have two option using piped stream using direct buffers (java.nio) Are these really my 2 best options (and which would people recommend?) Thanks! ...

Redirecting native dll stdout/stderr from within C#

Hi... I'm trying to redirect the output of a third-party native dll which outputs to stdout/stderr from within C#. The output of both stdout and stderr should go to a log file. Here's my idea (x2 for two streams): Create an AnonymousPipeServerStream Get the pipe's handle via _outServer.SafePipeHandle.DangerousGetHandle() Use P/Invoke...

Yahoo pipes - Datebuilder and filter out unwanted days

I have a ypipe I am trying to make. I have used a CSV file for the ypipe to get information from then I want to filter out the days before and after todays date. Which means I would want only that days events going coming out of the Ypipe but I keep having problems with the filter and datebuilding process. Can anyone help? The pipe ...

Writing my own shell... stuck on pipes?

Hi guys, For the past few days I have been attempting to write my own shell implementation but I seem to have gotten stuck on getting pipes to work properly. I am able to parse a line and fork off the commands between the pipes (ex: ls | sort) individually but can't seem to get them to pipe input from one into the other. I think I jus...

When should I use GCC's -pipe option?

The GCC 4.1.2 documentation has this to say about the -pipe option: -pipe Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble. I assume I'd be able to tell fr...

Force another program's standard output to be unbuffered using Python

A python script is controlling an external application on Linux, passing in input via a pipe to the external applications stdin, and reading output via a pipe from the external applications stdout. The problem is that writes to pipes are buffered by block, and not by line, and therefore delays occur before the controlling script receiv...

catching error codes in a shell pipe

I currently have a script that does something like ./a | ./b | ./c I want to modify it so that if any of a, b or c exit with an error code I print an error message and stop instead of piping bad output forward. What would be the simplest/cleanest way to do so? ...

Using Named Pipes as Files

Simple question here (though perhaps not such a simple answer): Is it possible to specify a path for an (existing) named pipe that can be used by programs as if they were opening on a normal file? According to this MSDN page, name pipes on the local computer can be referrenced using the following path syntax: \\.\pipe\PipeName, yet I'm...

Reading a file name from piped command

So I'm trying to get the C program to read a filename from the command line in the following format: cat (filename path) | (program name) i can get it to read the name of the input file when its entered as a command line argument, but it won't read from the concatenated argument here's the code, right now its reading the name of the fi...

Unbuffered CreateNamedPipe for use as stdout for CreateProcess

I would like to execute arbitrary command-line application and read its standard output as it gets produced. I use CreateNamedPipe to create a pipe and then supply other end (open used CreateFile) to CreateProcess. Provided the target process doesn't explicitly manipulates with standard output bufferring is there a way to make sure that ...

paste without temporary files in Unix

I'm trying to use the Unix command paste, which is like a column-appending form of cat, and came across a puzzle I've never known how to solve in Unix. How can you use the outputs of two different programs as the input for another program (without using temporary files)? Ideally, I'd do this (without using temporary files): ./progA > ...

Why don't I see pipe operators in most high-level languages?

In Unix shell programming the pipe operator is an extremely powerful tool. With a small set of core utilities, a systems language (like C) and a scripting language (like Python) you can construct extremely compact and powerful shell scripts, that are automatically parallelized by the operating system. Obviously this is a very powerful ...