title: Why does _popen work here, but boost::process does not?
body: <p>I have the following working code using _popen, on windows,</p>
  
  <pre><code>m_pGNUPlot = _popen("/gnuplot/bin/gnuplot.exe", "w");
  fprintf(m_pGNUPlot, "set term win\n");
  fprintf(m_pGNUPlot, "set term pngcairo\n"); 
  fprintf(m_pGNUPlot, "plot \"\Data.txt\" using 1:2 notitle\n"); 
  fprintf(m_pGNUPlot, "set output \"\Out.png\"\n");
  fprintf(m_pGNUPlot, "replot\n");
  fflush(m_pGNUPlot);
  </code></pre>
  
  <p>But the problem with this is that cmd window keeps poping up, and there is no way to prevent that (<a href="https://stackoverflow.com/questions/10020653/is-there-any-way-of-stopping-popen-opening-a-dos-window">Link</a>)
  So, I write the equivalent code in boost::process</p>
  
  <pre><code>bp::pipe m_Write;
  bp::environment env = boost::this_process::environment();
  m_Plot = new bp::child("/gnuplot/bin/gnuplot.exe", bp::std_in &lt; m_Write, env, boost::process::windows::hide);
  m_Write.write("set term win\n", sizeof(char)*14);
  m_Write.write("set term pngcairo\n", sizeof(char) * 19);    
  m_Write("plot \"\Data.txt\" using 1:2 notitle\n", sizeof(char)*35);
  m_Write("set output \"\Out.png\"\n", sizeof(char)*22);
  m_Write.write("replot\n", sizeof(char) * 8);
  </code></pre>
  
  <p>So, my question is - are the two code snippets equivalent? And if so, why might the second one not work?</p>