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: 
A pipe is simply an interprocess communication (IPC) mechanism used to connect the standard output of one process to the standard input of another.

An example is when you want to search a file for the word "pax":

```
cat filename | grep pax

```

and yes, I know you can `grep` the file directly but that doesn't explain how it works, does it?

This connects the standard output of the `cat` command to the standard input of the `grep` command. `cat` sends the contents of the file to its standard output, and `grep` reads its file (in this case) from its standard input. By connecting processes together like this, you can create your own tools consisting on any number of pipe segments. Things like:

```
show_users | grep pax | awk -F: '{print $4}' | tr '[a-z]' '[A-Z]' | cut -c1-20

```

A *broken* pipe is one where (usually) the receiver of the data has closed the connection while the sender is still trying to send stuff through.

For example, if you send a large file through a pager program (to view it one page at a time):

```
cat myfile | pager

```

and then do a `CTRL-BREAK`, this may cause the `pager` process to shut down its input pipe before `cat` has finished using it. That's one possibility for getting this broken pipe.

---

From a cursory [Google search](http://www.google.com.au/search?q=xcode+putpkt+broken+pipe), this particular problem seems to be related to ad hoc deployments and the solutions given usually include exiting most of your software and rebooting most of your devices.

This is probably serious enough to report the issue to Apple. The more developers who complain about it, the more likely something will be done to fix it.
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.