title: Open(), Close(), and Read() applied to Linux pipe file descriptiors
body: <p>This is probably a simple question, but I want to confirm my understanding of these functions - and possibly clarified if I'm completely wrong about them.</p>
  
  <p>Here's what's going on:</p>
  
  <p>I have a multi-threaded program that is passing data via pipes, using the unix <code>pipe()</code> function. Basically, two threads can write to the pipe (they're synchronized of course), and only one can read from the pipe. </p>
  
  <p>From my understanding, the <code>read()</code> command will attempt to read <code>x</code> number of bytes from the passed file descriptor parameter, and it will return 0 if <code>EOF</code> is reached. </p>
  
  <p>The number of bytes I write to the pipe is variable, so this presents a minor difficulty when reading from the pipe. I believe I read somewhere that using <code>close(my_pipe_file_descriptor)</code> throws in <code>EOF</code>. If this is the case, <code>read()</code> will return once it hits <code>EOF</code> - which would be great.</p>
  
  <p>If what I said above is correct - in reference to how <code>close()</code> and <code>read()</code> works - I have a question.</p>
  
  <p>If I call <code>close(my_pipe_file_descriptor)</code>, is the pipe destroyed, making any future calls to <code>open(my_pipe_file_descriptor)</code> invalid?</p>
  
  <p>I hope this makes sense. </p>