pipes

About using CreateFile to open a pipe in windows:

Quoted here: hPipe = CreateFile( lpszPipename, // pipe name GENERIC_READ | // read and write access GENERIC_WRITE, 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe 0, // default attribut...

Anonymous Pipes

I've written a two short programs that use anonymous pipes to communicate. The parent process shares the pipe handles by setting the standard IO handles for the child: // -- Set STARTUPINFO for the spawned process ------------------------- ZeroMemory(&m_ChildSI, sizeof(STARTUPINFO)); GetStartupInfo(&m_ChildSI); m_ChildSI.dwFlags ...

C homework assignment, pipes and processes

I've asked many, many C questions here on stackoverflow over the past few days. I feel like I'm at the final one. My assignment works ALMOST perfectly. Here is the premise: Write a program to query the user for two input strings. Each input string should be a unix command, with arguments allowed. For example, input 1 could be ls -l and ...

Is there an easy to implement or existing protocol to pass an object with pipe/socket in windows?

The object is essentially BYTEs of dynamic length. What's the easiest way to implement a send/receive mechanism? I got a tip follows but have no idea how to roll this protocol myself: Just remember that pipes, like sockets, don't guarantee that everything you put in the pipe will come out the other end in the same number of...

Find out if thread is awaiting for input (not output)

Greetings everyone. I'm capturing an output from a process created using CreateProcess() through the redirected named pipes for stdout and stderr. I also send an input to the redirected stdin. Everything goes fine except one big annoying thing. Sometimes it's unknown what data needs to be written in stdin and I present a simple dialog ...

How to tee into fd's instead of named pipes.

I want to take stdout of a process and analyze it with three different programs. I have been able to use named pipes, but can I use fd's instead. Here's what works so far: exec 3< <(myprog) tee p1 p2 >/dev/null < <(myprog) tee >...

Bash: piped argument to open command fails. Open commands excutes too early?

I'm pretty much a novice to shell scripting. I'm trying to send the output of some piped commands to an open command in bash in OSX. My ultimate goal is to compile a Flex/Actionscript application from TextWrangler by calling a bash script with a little Applescript and have the result played directly in a Flash Player. The Applescript is...

How to set a custom header using Yahoo Pipes?

I'm doing a pipe to retrieve RSS content from a private blogger's blog. The pipe first send a POST request to https://www.google.com/accounts/ClientLogin to get the Auth token. I use YQL for this (select * from htmlpost where url="https://www.google.com/accounts/ClientLogin" and postdata="Email=...). The question is, how could I set a cu...

Using Django Pipes , Bing Image Search API and Template !

Hello , I am using Django-pipes to parse Bing Image Search API , everything is going very smooth thu i can't render Thumbnail data Json : http://api.search.live.net/json.aspx?Web.Count=10&amp;query=linux&amp;sources=image&amp;Appid=APPID Model.py class BingImageSearch(pipes.Pipe): uri = "http://api.search.live.net/json.aspx" @st...

uncompressing a large number of files on the fly

i have a script that i need to run on a large number of files with the extension *.tar.gz. what i want to do is instead of uncompressing them and then running the script, i want to be able to uncompress them as i run the command and then work on the uncompressed folder, all with a single command. i think a pipe is a good solution for t...

How To Receive Output From A Child Process' STDOUT Without Blocking or Poling

I have a long-running console-based application Sender that sends simple text to STDOUT using non-buffered output such as cout << "Message" << flush(). I want to create an MFC dialog-based application (named Receiver) that starts Sender and can read it's output. Receiver should also be able to detect when Sender has died, or be able to...

Pipes to C++ Streams

is it possible to turn pipes genereated via pipe() on a POSIX-system into std::istreams and std::ostreams? if yes, how? i would prefer to use << and >> instead of read() and write() thanks in advance ...

Using pipes to delete all occurences of Thumbs.db file from Ubuntu Laptop

I have a laptop installed with Ubuntu 10.04. I migrated some of my files from one computer to this computer. But there are some files like Thumbs.db file whose every occurrence I want to get rid of. I tried using locate Thumbs.db | rm But dis didn't worked out (and clearly it should not). Then I tried using following, but quite expe...

TCL hangs when trying to close TCL pipe

When launching tclsh and typing this: close [open "|tclsh" w] it works fine. But, when in ~/.tclshrc you have package require Tk, the same line makes tclsh to HANG! The same issue is with all GUI packages like Tk, Itk, Img, Iwidgets, however with not GUI packages like Itcl, it worsk fine. How can I fix this issue? The point is to m...

Windows: Child Process with Redirected Input and Output

Hello, I'm trying to create a Child Process with Redirected Input and Output (as described here - http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx). For the people that don't want to bother reading the source code on that page, the author is using anonymous pipes to redirect the child's input and output. The parent proc...

Access denied when using AnonymousPipeStreams within a single process

I need to have an anonymous pipe within the same process to allow stream based async communication between two libraries. Everything works until I call the Stream.Read() - I get a UnauthorizedAccessException - Access to the path is denied. Any ideas? using (var pipeServer = new AnonymousPipeServerStream(PipeDirection.Out)) using (var p...

Python subprocess timeout?

Hello is there any argument or options to setup kinda subprocess.Popen(['..'], ..., timeout=20)? Sultan ...

C++ pipes in Objective-C

I made the transition from C++ to objective-C a while ago, and am now finding NSLog() tiresome. Instead, still in Objective-C, I would like to be able to write something like stdout << "The answer is " << 42 << "\n"; (I know that NSLog prints to stderr, I could put up with writing stderr << "Hello world";) Basically, I just want to...

Android: invoking a regular Java-style program with i/o redirection

Hi, I have an apk (or .class, whatever) with a 'public static void main'-method (java style) which does some things. Compiling and installing the apk this gives works fine (from eclipse). Now from a regular Android app I would like to invoke that code while redirecting its stdin/stdout to Input-/Output- Stream objects. Is this possibl...

Win32: transactions on anonymous pipes

Documentation for TransactNamedPipe Function claims that "This parameter can also be a handle to an anonymous pipe, as returned by the CreatePipe function." This would mean that it is possible to use transactions on anonymous pipes. As I understand it transactions are read/write operations and anonymous pipes are either read or write - i...