pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:920:   //! Open for reading. Data written by the process to stdout   //! is available for read.   //! @value "w"   //! Open for writing. Data written to the file is available   //! to the process on stdin.   //! @endstring   //!   //! @seealso   //! @[system], @[spawn]    - Stdio.FILE|string popen(string s, string|void mode) { -  if(mode) -  return fpopen(s,mode); -  else + variant string popen(string s) {    return fpopen(s)->read();   }    -  + variant Stdio.FILE popen(string s, string mode) { +  return fpopen(s,mode); + } +    protected Stdio.FILE fpopen(string s, string|void mode)   {    Stdio.FILE f = Stdio.FILE();    if (!f) error("Popen failed. (couldn't create file)\n");       Stdio.File p = f->pipe();    if(!p) error("Popen failed. (couldn't create pipe)\n");       if (mode == "w")    spawn(s, p, 0, 0, /*destruct, f*/);