Question: ![enter image description here](https://i.stack.imgur.com/SKrWX.png)

I've gotten the "broken pipe" error from Xcode one time too many. I'm now curious to know exactly what a pipe is.

What is the concept of a "pipe" and how can it be "broken"?

Answer: 
The `|` character is often called a pipe. In the various UNIX shells (that I know of) it can be used to pipe the output of one command to the input of another.

```
cat myfile.txt | head

```

The `head` command only shows the first few lines of its input. At that point, it closes its input. This poses a problem for the command that was generating the input. Where does it write to? Whenever we have this situation, or the situation when the writing process ends before the reader is through, it's called a "broken pipe".

To prevent the `cat` command from lingering forever, the UNIX standard defines a special signal ([SIGPIPE](http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html#tag_02_10_14), [signal 13](http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?signal.h+3)) which it send to `cat`. The default action for this signal is to kill the process, which makes the `cat` end nicely.

It looks like the application you're using has installed a signal handler for all signals, including SIGPIPE, which creates the little popup message that you see.
A “broken” pipe is one where one end has been `close()`'d and the other is being read from or written to. For example, in the following shell command:

```
cat foo | less

```

The `cat` process holds the writing end of the pipe, and the `less` process the reading one. If the reader process closes the pipe, the pipe is broken (and therefore useless); the writer process will receive the “broken pipe” error from the operating system.