pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:435:   //!   //! @param argv   //! Arguments for the new process.   //!   //! @param options   //! Process creation options. See @[Process.Process] for details. May also   //! specify "add_predefines", "add_program_path", or "add_include_path" in   //! order to include these components in command path (module path is   //! included by default.)   //! + //! @param launcher + //! Optional launcher prefix command used to spawn the pike binary. + //! + //! When used this is typically something like + //! @expr{({ "/usr/bin/valgrind" })@}. + //! + //! Defaults to the empty array. + //!   //! @seealso   //! @[Process.Process] - Process spawn_pike(array(string) argv, void|mapping(string:mixed) options) + Process spawn_pike(array(string) argv, void|mapping(string:mixed) options, +  array(string)|void launcher)   {    if (!runpike) {    array(string) res = ({    master()->_pike_file_name,    });    if (master()->_master_file_name)    res+=({"-m"+master()->_master_file_name});    foreach (master()->pike_module_path;;string path)    res+=({"-M" + path});    if(options && options->add_predefines)
pike.git/lib/modules/Process.pmod:474:    }       if (sizeof(res) && !has_value(res[0],"/")   #ifdef __NT__    && !has_value(res[0], "\\")   #endif /* __NT__ */    )    res[0] = search_path(res[0]);    runpike = res;    } -  return Process(runpike + argv, options); +  if (!launcher) launcher = ({}); +  return Process(launcher + runpike + argv, options);   }      //! Easy and lazy way of using @[Process.Process] that runs a process   //! and returns a mapping with the output and exit code without   //! having to make sure you read nonblocking yourself.   //!   //! @param args   //! Either a command line array, as the command_args   //! argument to @[create_process()], or a string that   //! will be splitted into a command line array by