pipes

What are all the differences between pipes and message queues?

What are all the differences between pipes and message queues? Please explain both from vxworks & unix perspectives. I think pipes are unidirectional but message queues aren't. But don't pipes internally use message queues, then how come pipes are unidirectional but message queues are not? What are the other differences you can think...

Why does ffmpeg stop randomly in the middle of a process?

ffmpeg feels like its taking a long time. I then look at my output file and i see it stops between 6 and 8mbs. A fully encoded file is about 14mb. Why does ffmpeg stop? My code locks up on StandardOutput.ReadToEnd();. I had to kill the process (after seeing it not move for more then 10 seconds when i see it update every second previously...

How can I read piped input in Perl on Windows?

I am trying to create something in Perl that is basically like the Unix tee command. I'm trying to read each line of STDIN, run a substitution on it, and print it. (And eventually, also print it to a file.) This works if I'm using console input, but if I try to pipe input to the command it doesn't do anything. Here's a simple example: ...

Pipe multiple files (gz) into C program

I've written a C program that works when I pipe data into my program using stdin like: gunzip -c IN.gz|./a.out If I want to run my program on a list of files I can do something like: for i `cat list.txt` do gunzip -c $i |./a.out done But this will start my program 'number of files' times. I'm interested in piping all the files in...

Writing/Reading struct w/ dynamic array through pipe in C

I have a struct with a dynamic array inside of it: struct mystruct{ int count; int *arr; }mystruct_t; and I want to pass this struct down a pipe in C and around a ring of processes. When I alter the value of count in each process, it is changed correctly. My problem is with the dynamic array. I am allocating the array as such: mys...

are posix pipes lightweight?

In a linux application I'm using pipes to pass information between threads. The idea behind using pipes is that I can wait for multiple pipes at once using poll(2). That works well in practice, and my threads are sleeping most of the time. They only wake up if there is something to do. In user-space the pipes look just like two file-h...

C# CreatePipe() -> Protected memory error

Hi all, I trying to create a pipe using C#. The code is quite simple but I get a error saying "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here the COMPLETE code of my form : public partial class Form1 : Form { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastErr...

Email pipe to php script working only sometimes

I have a php pipe script that receives an email, takes an attached *.csv from it and parses it. However, when the email is sent from where it is supposed to be coming from, it silently errors. But when I take that same email and resend it from my address it goes through just fine. is there any simple reason it could be doing this? ...

cat file | ... vs ... <file

Is there a case of ... or context where cat file | ... behaves differently than ... <file? ...

Problem with apostrophes and other special characters when using aspell in windows

Hi there, We seem to be having a problem with the spell checker on our content management system where it marks the ve part of We’ve as a misspelling. The spellchecker uses aspell which is called from a script on the server which executes the cmd.exe and uses it to pipe a file into aspell (it's a long winded way I know, but our server s...

How do I check if my program has data piped into it.

Im writing a program that should read input via stdin, so I have the following contruct. FILE *fp=stdin; But this just hangs if the user hasn't piped anything into the program, how can I check if the user is actually piping data into my program like gunzip -c file.gz |./a.out #should work ./a.out #should exit program with nice msg. ...

How to use Facebook or othr social API to extend a personal site

I am designing a new site, and currently I'm looking for a powerfull CMS (like Wordpress, etc) to design my site based on it. every CMS has its own framework and that framework provide some functionality. But I want to create a flexible Framework wich can collaborate with ( and use from ) the other sites provided API to extend its func...

How to get the formatted view of YQL as result??

YQL gives out result only in tree view. Is there any way to get the result in Formatted view?? ...

Unix Piping using Fork and Dup

Lets say within my program I want to execute two child processes, one to to execute a "ls -al" command and then pipe that into "wc" command and display the output on the terminal. How can I do this using pipe file descriptors so far the code I have written: An example would be greatly helpful int main(int argc, char *argv[]) { int pipef...

How can get a filehandle for a Perl program's output?

I have an encrypted file X1, I have a Perl program P1 that decrypts the X1. I am parsing the decrypted file using a Perl program p2. X1--P1(decrypter) --> X2(plain text file) --p2(parser) --> parse output My parser is based on XML::Parser. It can work with a filehandle to the decrypted file. Now I am getting the X2 and storing it in t...

Forking with Pipes

Hello I have tried to do fork() and piping in main and it works perfectly fine but when I try to implement it in a function for some reason I don't get any output, this is my code: void cmd(int **pipefd,int count,int type, int last); int main(int argc, char *argv[]) { int pipefd[3][2]; int i, total_cmds = 3,count = 0; int in = 1;...

Bad File descriptor

Does anyone see a problem with this, its not working saying bad file descriptor not sure why? pipe(pipefd[0]); if ((opid = fork()) == 0) { dup2(pipefd[0][1],1);/*send to output*/ close(pipefd[0][0]); close(pipefd[0][1]); execlp("ls","ls","-al",NULL); } if((cpid = fork())==0){ dup2(pipefd[0][1],0);/*read from in...

why egrep's stdout did not go through pipe?

Hi, i got a weird problem regarding egrep and pipe I tried to filter a stream containing some lines who start with a topic name, such as "TICK:this is a tick message\n" When I try to use egrep to filter it : ./stream_generator | egrep 'TICK' | ./topic_processor It seems that the topic_processor never receives any messages However, wh...

how to feed a file to telnet

hello community, trying to understand http and headers i was playing around with telnet to send requests. to not type everything again and again and again i thought i'd write a small textfile with all the commands i need. my file is as simple as follows: GET /somefile.php HTTP/1.1 Host: localhost i then try to feed it to telnet with...

How do I redirect stdin/stdout when I have a sequence of commands in Bash?

I've currently got a Bash command being executed (via Python's subprocess.Popen) which is reading from stdin, doing something and outputing to stdout. Something along the lines of: pid = subprocess.Popen( ["-c", "cmd1 | cmd2"], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ...