pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:887:    ret += ({last});    last = piece[1..];    break;    }    }    if (sizeof (last) || always_keep_last)    ret += ({last});    return ret;   }    - Process spawn(string command, void|Stdio.Stream stdin, -  void|Stdio.Stream stdout, void|Stdio.Stream stderr, -  // These aren't used. Seems to be part of something unfinished. /mast + __deprecated__ Process spawn(string command, +  void|Stdio.Stream stdin, +  void|Stdio.Stream stdout, +  void|Stdio.Stream stderr, +  // These aren't used. +  // Seems to be part of something unfinished. /mast    //function|void cleanup, mixed ... args    )   //! Spawns a process that executes @[command] as a command shell   //! statement ("@expr{/bin/sh -c @[command]@}" for Unix, "@expr{cmd /c   //! @[command]@}" for Windows).   //!   //! @param stdin   //! @param stdout   //! @param stderr   //! Stream objects to use as standard input, standard output and
pike.git/lib/modules/Process.pmod:926: Inside #if defined(__NT__)
   // make sure it is not modified by create_process    if (sizeof(command) <= 1 ||    command[0] != '\"' || command[sizeof(command)-1] != '\"')    command = "\"" + command + "\"";    return Process(({ "cmd", "/c", command }),data);   #else /* !__NT__ */    return Process(({ "/bin/sh", "-c", command }),data);   #endif /* __NT__ */   }    + #pragma no_deprecation_warnings +    //! @decl string popen(string command)   //! Executes @[command] as a shell statement ("@expr{/bin/sh -c   //! @[command]@}" for Unix, "@expr{cmd /c @[command]@}" for Windows),   //! waits until it has finished and returns the result as a string.   //!   //! @seealso   //! @[system], @[spawn]      //! @decl Stdio.FILE popen(string command, string mode)   //! Open a "process" for reading or writing. The @[command] is executed
pike.git/lib/modules/Process.pmod:951:   //! 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]    - variant string popen(string s) { + variant __deprecated__ string popen(string s) {    return fpopen(s)->read();   }    - variant Stdio.FILE popen(string s, string mode) { + variant __deprecated__ Stdio.FILE popen(string s, string mode) {    return fpopen(s,mode);   }    - protected Stdio.FILE fpopen(string s, string|void mode) + protected __deprecated__ 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*/);    else    spawn(s, 0, p, 0, /*destruct, f*/);    p->close();    destruct(p);       return f;   }    - int system(string command, void|Stdio.Stream stdin, + __deprecated__ int system(string command, void|Stdio.Stream stdin,    void|Stdio.Stream stdout, void|Stdio.Stream stderr)   //! Executes @[command] as a shell statement ("@expr{/bin/sh -c   //! @[command]@}" for Unix, "@expr{cmd /c @[command]@}" for Windows),   //! waits until it has finished and returns its return value.   //!   //! @param stdin   //! @param stdout   //! @param stderr   //! Stream objects to use as standard input, standard output and   //! standard error, respectively, for the created process. The   //! corresponding streams for this process are used for those that   //! are left out.   //!   //! @seealso   //! @[spawn], @[popen]   {    return spawn(command, stdin, stdout, stderr)->wait();   }    -  + #pragma deprecation_warnings +    #ifndef __NT__   #if constant(fork)   constant fork = predef::fork;   #endif      #if constant(exece)   constant exece = predef::exece;   #endif      #if constant(fork) && constant(exece)