2
0
mirror of https://github.com/boostorg/process.git synced 2026-02-01 08:42:15 +00:00

updated examples

This commit is contained in:
klemens-morgenstern
2016-10-23 01:38:14 +02:00
parent 1c0f992721
commit d7ff198dc0
18 changed files with 138 additions and 296 deletions

View File

@@ -9,15 +9,16 @@
#include <boost/process.hpp>
using namespace boost::process;
namespace bp = boost::process;
int main()
{
//[modifiy_env
boost::process::environment my_env = boost::this_process::environment(); //empty env, that would fail.
system("test.exe", my_env);
//]
//[inherit_env
system("test.exe", env["PATH"]+="/tmp");
//]
bp::environment my_env = boost::this_process::environment();
my_env["PATH"] += "/foo";
bp::system("test.exe", my_env);
bp::system("test.exe", bp::env["PATH"]+="/bar");
}