Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

... something similar to /dev/null, but that just blocks all bytes that are written to it?

What I need is a trick to hold an arbitrary executable in memory by blocking its output. Pipes don't seem to be usable, because the output gets written to a buffer first.

share|improve this question
up vote 27 down vote accepted

You can create a named pipe (fifo) using mkfifo. Writes to this type of special file will block until a process reads from it.

$ mkfifo blocker
$ echo hello > blocker # "hangs"

In another session:

$ cat blocker
hello                  # the `echo` above unblocks after this
share|improve this answer
Works great, thank you Mat! – Armin Jun 19 '11 at 9:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.