Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a broken pipe error?

Running code in python, I discovered a "Broken Pipe Error." Can someone please explain to me what this is simply?

Thanks.

like image 372
louie mcconnell Avatar asked Jun 08 '14 23:06

louie mcconnell


1 Answers

A pipe connects two processes. One of these processes holds the read-end of the pipe, and the other holds the write-end.

When the pipe is written to, data is stored in a buffer waiting for the other processes to retrieve it.

What happens if a process is writing to a pipe, but the process on the other side suddenly exits or closes the pipe? Or the other way round, a process is reading just as the writer finishes or closes?

This input/output error is called a broken pipe.

like image 198
slezica Avatar answered Sep 16 '22 16:09

slezica