boost-process
boost-process copied to clipboard
wrong CreateProcess call
I want to call the executable svn
which is defined in my PATH environment variable with some arguments. I've used set_args
instead of run_exe
. The execute call fails, boost-process creates a wrong CreateProcess call.
std::vector<std::string> const args = { "svn", "propget", "-R", "svn:externals"};
using namespace boost;
system::error_code ec;
process::execute(process::set_args(args), process::set_on_error(ec));
See CreateProcess
If lpApplicationName is NULL, the first white space–delimited token of the command line specifies the module name. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin (see the explanation for the lpApplicationName parameter). If the file name does not contain an extension, .exe is appended. Therefore, if the file name extension is .com, this parameter must include the .com extension. If the file name ends in a period (.) with no extension, or if the file name contains a path, .exe is not appended. If the file name does not contain a directory path, the system searches for the executable file in the following sequence:
The directory from which the application loaded.
The current directory for the parent process.
The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this function does not search the per-application path specified by the App Paths registry key. To include this per-application path in the search sequence, use the ShellExecute function.