Tag Info

Hot answers tagged

5

The process will be able to write PIPE_BUF bytes (see linux/limits.h) into the pipe. Then it will be stuck, until some of the data will be read. The buffered data will be kept around as long as at least one end of the pipe is open – there is no "timeout" or anything like that. Buffers are kept in memory, however, and will not persist reboots. See the ...


5

I'm not sure why you don't want to redirect to a file. There are two methods I will provide here. One method is to redirect to and read from a file, the other is a set of programs. Named pipes What I did was write two programs for .NET 4. One sends output to a named pipe, the other reads from this pipe and displays to the console. Usage is quite simple: ...


2

Use socat, you don't need the pipes and fifos


1

I'd use tcpdump (tutorial) for this. I think the command you want would look like this: sudo tcpdump -i eth0 -s0 -v port 8080


1

ncat can do this quite easily, using the --sh-exec argument. The following command will allow you to see both directions of a TCP connection live, and allows multiple connections. The connection to example.com is done once for each connection received on localhost:8080. ncat -lkv localhost 8080 -c 'tee /dev/stderr | ncat -v example.com 80 | tee ...


1

Put all the completed uploaded files in one directory, with whatever web language you are using. Then you can schedule a cronjob with your script, to run for example every hour and convert the videos that are in the pending/ directory. You might want to use flock so that only one instance of this script can run at the same moment, even if it takes longer ...


1

You would probably need image2pipe instead of image2. I find it strange that it isn't documented online, but it's listed in ffmpeg -formats anyway.


1

The easiest way would be via tee http://man7.org/linux/man-pages/man1/tee.1.html and a named pipe. http://man7.org/linux/man-pages/man1/mkfifo.1.html Create a fifo $ mkfifo temporaryfile Insert the tee into the middle of the pipe outputting to that file $ command | tee temporaryfile | othercommand & Feed the contents of the fifo into your third ...


1

Not with the standard shell (CMD.EXE). For programmers, it's fairly easy. Just grab the two pipes of a process that you started.


1

this is no different from running xargs on the interactive shell and terminate with a newline, so it will finish and exit. you would have to write a loop and execute for each line of input from stdin such as while :; do xargs < /tmp/cmds; done not tested so you may need to tweak.


1

There is a caveat concerning the reading from a named pipe. When you open a named pipe your open() call hangs until a writer shows up. When a writer shows up subsequent read() calls will return whatever data the writer has written to the pipe. However, when the writer closes the pipe (or exits) the read() calls start returning 0 (rather than blocking). This ...


1

You can probably do this with ordinary files if your don't need any concurrency at all. The principle for named pipes is the same Change foo | \ bar | \ baz To foo > foo.out bar < foo.out > bar.out baz < bar.out If the *.out are named pipes then I suspect the programs writing to them may get blocked waiting for their output buffers to be ...



Only top voted, non community-wiki answers of a minimum length are eligible