pipes

Shared memory between 2 processes (applications)

Hi, I cant find any useful answer for this question, although it has been asked in a different way several times I want to share a memory between 2 processes (2 different applications). so that one of them can write to that memory and the other can read. is this possible in .NET? how? Thanks ...

Integrate Yahoo Pipes into PHP App?

Hi, I just found this pipe. http://pipes.yahoo.com/jonbishop/8vA1gjvl3RGqWknCBB50VA I was just wondering if it was possible to integrate this into my web app? How would I go about doing it. Basically, I have a form on my website - I would like this form to interact with this pipe to get the relevant data. Could someone post a summar...

How to diff file and output stream "on-the-fly"?

I need to create a diff file using standard UNIX diff command with python subprocess module. The problem is that I must compare file and stream without creating tempopary file. I thought about using named pipes via os.mkfifo method, but didn't reach any good result. Please, can you write a simple example on how to solve this stuff? I tri...

Pipe is not receiving all output from child process

I wanted to open up a pipe to a program and read output from it. My initial inclination was to use popen(), but the program takes a number of options, and rather that fighting with shell quoting/escaping, I decided to use a combination of pipe(), fork(), dup() to tie the ends of the pipe to stdin/stdout in the parent/child, and execv() t...

wget to memory (bypassing disk)

Is it possible to download contents of a website (a set of html pages) straight to memory without writing to disk? I have a cluster of machines with 24G ram each, but I'm limited by a disk quota to several hundreds MB. I was thinking of redirecting the output of wget command for example to some kind of in-memory structure without storing...

Example for using Python Twisted with File Descriptors

I'm looking to use twisted to control communication across Linux pipes (os.pipe()) and fifos (os.mkfifo()) between a master process and a set of slave processes. While I'm positive tat it's possible to use twisted for these types of file descriptors (after all, twisted is great for tcp sockets which *nix abstracts away as file descriptor...

Pipe file disappears but still works

I have 2 programs, both written in Java. The first launches several instances of the second and then communicates with them via pipe files. When running 2 instances of the program, (I'll call the launcher A and the others B and C) everything works fine. The pipe files are in /tmp/[pid of A]/B and /tmp[pid of A]/C. If B or C close then ot...

Best way to modify a file when using pipes?

I often have shell programming tasks where I run into this pattern: cat file | some_script > file This is unsafe - cat may not have read in the entire file before some_script starts writing to it. I don't really want to write the result to a temporary file (its slow, and I don't want the added complication of thinking up a unique new ...

String copy using pipes

Hi All, i have written the following code to copy a string "hello world" to another char array using fork and pipes instead of using standard library functions or standard i/o streams. The program is compiling successfully but i am not getting any output. Even, the printf's output are not being shown. # include <string.h> # include <uni...

Detecting death of spawned process using Window CRT

Executive summary: I need a way to determine whether a Windows process I've spawned via _spawnl and am communicating with using FDs from _pipe has died. Details: I'm using the low-level CRT function in Windows (_eof, _read) to communicate with a process that was spawned via a call to _spawnl (with the P_NOWAIT) flag. I'm using _pipe t...

Redirect std*** from C++ to Java for Logging

I have a C++ application and a Java application that need to log messages in the same way. My Java application uses Apache Commons Logging, backed by a Log4j configuration. I need a single log4j configuration so I can change my logging preferences in one location. In my C++ application, I have captured all calls to printf() and fprintf(s...

How can I detach a process from a CGI so I can store and read files from memory?

Is it possible that I would be able to spawn a detached daemon like process, from a CGI script that stores read text files in memory, then re-access the memory in the next cgi execution, reading the data using a pipe? Would most hosting ISP's, allow detached processes? Are memory pipes fast, and easy to code/work with on a unix/linux sy...

Problems writing to a unix pipe through Java

Hey, I am writing to a framebuffer located at "/dev/fb0". Everything works fine until I try to write again to the pipe using an OutputStream, which hangs the program. I have resolved this by closing the output stream and then recreating it, but this seems awfully slow and blunt. Framebuffer.java public class Framebuffer extends ...

Output to console even ran in background

I am running a python script in background, but why does it still prints to console, even when piped to a file? I tried the following command: python script.py & python script.py > output.txt & I tried with a simple script: print "hello world" With python script.py & It still prints to console. But python script.py > output.t...

Implement piping ("|") using C..(fork used)

#include<stdio.h> #include<unistd.h> #include<stdlib.h> int main(int argc,char **argv) { int fd[2]; pid_t childpid; pipe(fd); childpid=fork(); if (childpid == -1) { perror("Error forking..."); exit(1); } if (childpid) /*parent proces*/ //grep .c { wait(&childpid); //...

.NET 3.5 (C#) Named pipes over network

I'm struggling to get a .NET (NOT a WCF) named pipe to communicate across the network. The MSDN documentation implies this is possible, nay trivial. But my code: using (NamedPipeClientStream pipeClient = new NamedPipeClientStream(servername, "myPipe", PipeDirection.InOut, PipeOptions.None, TokenImpersonationLevel.Impersonation)) ... ...

How to select on STDIN_FILENO ignoring signals?

Please check the following code #include <stdio.h> #include <string.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <sys/types.h> #include <signal.h> #include <sys/time.h> #include <time.h> #define CLOCKID CLOCK_REALTIME #define SIG SIGRTMIN int reset = 0; void changemode(int); int kbhit(void); int pfds[2]; s...

Capturing the effects of SetConsoleTextAttribute when redirected through a Pipe?

I've redirected stdout of a child process spawned with CreateProcess to a pipe. It works fine except that, as far as I can tell, no information about color changes are coming through. The child process is using SetConsoleTextAttribute to change the text color--is it possible to detect this through the pipe and, if so, how? I'm ultimat...

zcat files in and not in gzip format

I have all my Apache access log files as access.log, access.log.1 access.log.1.gz etc... What I want is to zcat all files in and not in gzip format and pipe them into an X program. I know I can do: zcat /var/log/apache2/access.log.*.gz | someapp... but that will just work for *.gz and not the first two logs. Any ideas will be appreciat...

Linux: How would I pipe text into a program properly?

I've looked but can't find anything. A program for example, a TTS I use lets you do the following: ~#festival -tts | echo "I am to be spoken" Which is really nice, but for programs I use such as hexdump, I don't know how to pipe text into it. I can REALLY use some of these things, some examples I tried (but failed) are like so: ~#gte...