Boost logo

Boost :

Subject: Re: [boost] [process] working directory issue
From: Boris Schaeling (boris_at_[hidden])
Date: 2012-05-18 16:49:31


On Tue, 15 May 2012 09:08:29 -0600, Bertolino, Keith D.
<KBertolino_at_[hidden]> wrote:

Keith,

> I'm attempting to use boost::process to launch a command line tool

I'm not entirely sure which Boost.Process draft you use and where you got
it from. So maybe my answers don't make sense for the version you use.

> [...]1. Is there a way to set the working directory (and if so,
> will
> this fix my problem)?

process::context should have a member variable called work_dir (a
std::string).

> 2. Is there a way to set a time-out on the underlying process (ie.
> kill the process if it becomes unresponsive)?

Boost.Asio 1.49 has a signal_set and a windows::object_handle which you
could use to asynchronously wait for a child process to exit. If your
handlers aren't called in time you could kill the child process.

Boris

> [...]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk