pipes

Bad pipe filedescriptor when reading from stdin in python

Duplicate of this question. Vote to close. Consider this at the windows commandline. scriptA.py | scriptB.py In scriptA.py: sys.stdout.write( "hello" ) In scriptB.py: print sys.stdin.read() This generates the following error: c:\> scriptA.py | scriptB.py close failed: [Errno 22] Invalid argument Traceback (most recent call las...

How Does Piping Work in Linux?

Probably a simple question but... How does piping work? If I run a program via CLI and redirect output to a file will I be able to pipe that file into another program as it is being written? Basically when one line is written to the file I would like it to be piped immediately to my second application (I am trying to dynamically dra...

How do you automatically colorize program outputs in a bash shell?

I want to take any program that outputs to the screen, catch the output, and colorize certain keywords before they are output to the screen. For example, here's the normal program output: bash# <program> blah blah blah <-- this output has no color vs. bash# <program> blah blah blah <-- this output is colorful Ideally it...

Why doesn't a * in my pipe open in Perl work on Windows?

I am having this strange issue with Perl. I am trying to execute an external program from inside my Perl script and this external program takes string + wildcard as parameters. My Perl program looks like this my $cmd_to_run = 'find-something-in-somedb myname* |' open(procHandle, $cmd_to_run); # I am using open because I want to ...

UNIX/Linux IPC : Reading from a pipe. How to know length of data at runtime?

I have a child process which generates some output of variable length and then sends it to the parent using a half duplex pipe. In the parent, how do I use the read() function? Since the data can be of different length each time, how can I at run time know the size of the data to do any malloc() for a buffer? Can the fstat() function be ...

ImageMagick and Piping

I have the following commands that create a sprite containing a normal state and a hover state: convert -background none -pointsize 11 -fill white -size 100x -gravity NorthWest caption:'Test' top.png convert -background none -pointsize 11 -fill grey -size 100x -gravity SouthWest caption:'Test' bottom.png montage top.png bottom.png -geom...

System.IO.Pipes on Windows 2000

Is there any way to get .NET 3.5 working on Windows 2000? Specifically, the only part I need is the System.Core.dll to use the System.IO.Pipes namespace. Hackish workaround methods are fine, if necessary. Thanks! ...

Some WinAPI to check which process created a named pipe?

Is there some WinAPI call which would tell me who (which process) has created the named pipe? Note: Asking this questions, I have a feeling it "smells" somehow, and a proper design will be to communicate the process ID/handle using other means, however getting this information from the pipe itself would be simpler, and therefore if ther...

CallNamedPipe & NamedPipeServerStream, access denied?

I'm trying to do some IPC between a managed and unmanaged process. I've settled on named pipes. I'm spinning up a thread in managed code, using NamedPipeServerStream: using (NamedPipeServerStream stream = new NamedPipeServerStream("MyPipe", PipeDirection.In)) { while (true) { stream.WaitForConnection(); stream.Read(buffer,...

How to cross-platform port unix pipes?

I have a code that looks like this: uses this library #include <unistd.h> #define READ_FD 0 #define WRITE_FD 1 int m_pipe[2]; if(pipe(m_pipe) != -1) { unsigned long Id = gdk_input_add(m_pipe[READ_FD], GDK_INPUT_READ, Callback, (gpointer)this); } and it surprisingly builds on both linux(all major flavors: AS3, AS5, solaris) an...

Is there a non-named pipes in windows api?

Posix provided both named and non-named pipes... Can you have a non-named pipes and windows and how to use them? ...

How to use anonymous pipes in windows api (and pass to gtk function)?

I need to be able to pass int value representing fd (pipe fd) to gtk function as a first parameter gint gdk_input_add gint source, GdkInputCondition condition, GdkInputFunction function, gpointer data); How do I do that, as CreatePipe returns HANDLE which is NOT int? Thanks ...

Unix pipes question

I would like to know, if there is a way to print the pipes associated with a process, like "ipcs -s" for semaphores. ...

Shell: SVN status pipe to php to check syntax

I know this is simple but I just cant figure it out. I have a bunch of files output by "svn st" that I want php to do a syntax check on the command line. This outputs the list of files: svn st | awk '{print $2}' And this checks a php script: php -l somefile.php But this, or variants of, doesn't work: svn st | php -l '{print $2}' Any...

Yahoo Pipes: More complex RSS output?

I've been working with pipes for a while now, I am trying to output more than the basic structure of: Item title link description guid pubDate I want to publish more data in the RSS feed under different fields but cannot figure out if this is even possible. Any ideas? ...

Yahoo Pipes: Using URL Builder to customize item.link in RSS Item Builder Module

http://pipes.yahoo.com/pipes/pipe.edit?%5Fid=85a288a1517e615b765df9603fd604bd I am trying to build a baseball media feed. The 'fetch data' output I am using doesn't spit out a link to the media though it does provide the video ID [item.contentID] which needs to be appended to the following URL: mlb.mlb.com/media/video.jsp?content_id= I...

Regex and Yahoo Pipes: How to replace end of url

Here's the Pipe though you may not need it to answer the question: http://pipes.yahoo.com/pipes/pipe.info?%5Fid=85a288a1517e615b765df9603fd604bd I am trying to modify all url's as so: http://mediadownloads.mlb.com/mlbam/2009/08/12/mlbf_6073553_th_3.jpg with http://mediadownloads.mlb.com/mlbam/2009/08/12/mlbtv_6073553_1m.mp4 The synta...

How to execute the output of a command within the current shell?

Hi, I'm well aware of the source (aka .) utility, which will take the contents from a file and execute them within the current shell. Now, I'm transforming some text into shell commands, and then running them, as follows: $ ls | sed ... | sh ls is just a random example, the original text can be anything. sed too, just an example for...

c# redirect (pipe) process output to another process

Hi I am trying to run a process in c# using the Process class. Process p1 = new process(); p1.startinfo.filename = "xyz.exe"; p1.startinfo.arguments = //i am building it based on user's input. p1.start(); So based on user input i am building the argument value. Now i have a case where i have to pipe the output of p1 to another proc...

splice from socket to pipe frozen

This code is based on splice-fromnet.c and splice-cp.c to splice from a socket to a pipe and from the pipe to a file but for some reason the first call to splice never returns. static size_t splice_from_net_to_file(int infd, int outfd) { int p[2]; size_t total = 0; if (pipe(p) == -1) return error("pipe"); while...