Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Process] Status request
From: Damien Kick (dkick_at_[hidden])
Date: 2013-06-26 10:29:17


Thought that perhaps somebody on this list would know if/where a/the most current version of Boost.Process might be found. Or has this library been abandoned?

Begin forwarded message:

From: Damien Kick <dkick_at_[hidden]<mailto:dkick_at_[hidden]>>
Subject: Boost.Process
Date: June 25, 2013 5:16:10 PM CDT
To: <boris_at_[hidden]<mailto:boris_at_[hidden]>>

I've found your version of Boost.Process at <http://www.highscore.de/cpp/process/index.html>. I noticed that the date on this page is from 2009; are you still working on this library? If not, thank you for your effort so far.

If you are still working on the library, I was hoping you might have some insights and/or help for a compilation error I'm finding when trying to use Boost.Process with Boost 1.53 on Windows 7 with Visual Studio 2010 SP1. First of all, I had to add a header file to .../process/operation.hpp; i.e. I had to add #include <boost/filesystem/operation.hpp> to get the declaration of boost::filesystem::filesystem_error. But then I'm finding the following error

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: test-cma, Configuration: Debug Win32 ------
2> cma.cpp
2>Z:\Documents\perforce\dkick-mac\projects\DandM\DMTarget\windows-6.1\msvc-10.0\include\boost/process/detail/pipe.hpp(129): error C2665: 'boost::system::system_error::system_error' : none of the 7 overloads could convert all the argument types
2> Z:\Documents\perforce\dkick-mac\projects\DandM\DMTarget\windows-6.1\msvc-10.0\include\boost/system/system_error.hpp(39): could be 'boost::system::system_error::system_error(int,const boost::system::error_category &,const std::string &)'
2> Z:\Documents\perforce\dkick-mac\projects\DandM\DMTarget\windows-6.1\msvc-10.0\include\boost/system/system_error.hpp(43): or 'boost::system::system_error::system_error(int,const boost::system::error_category &,const char *)'
2> while trying to match the argument list '(DWORD, overloaded-function, const char [54])'
========== Build: 1 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

Which is coming from .../boost/process/detail/pipe.hpp (the bold italic line below). From the quick skim I've given some of the documentation, I think the fact that BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE is not defined means that I would find some features disabled, right? How is this determined; i.e. whether or not to define BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE?

# if defined(BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE)
        static unsigned int nextid = 0;
        std::string pipe = "\\\\.\\pipe\\boost_process_" + boost::lexical_cast<std::string>(::GetCurrentProcessId()) + "_" + boost::lexical_cast<std::string>(nextid++);
        hs[0] = ::CreateNamedPipeA(pipe.c_str(), PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, 0, 1, 8192, 8192, 0, &sa);
        if (hs[0] == INVALID_HANDLE_VALUE)
            boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: CreateNamedPipe failed"));
        hs[1] = ::CreateFileA(pipe.c_str(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
        if (hs[1] == INVALID_HANDLE_VALUE)
            boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: CreateFile failed"));

        OVERLAPPED overlapped;
        ZeroMemory(&overlapped, sizeof(overlapped));
        overlapped.hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
        if (!overlapped.hEvent)
            boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: CreateEvent failed"));
        BOOL b = ::ConnectNamedPipe(hs[0], &overlapped);
        if (!b)
        {
            if (::GetLastError() == ERROR_IO_PENDING)
            {
                if (::WaitForSingleObject(overlapped.hEvent, INFINITE) == WAIT_FAILED)
                {
                    ::CloseHandle(overlapped.hEvent);
                    boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: WaitForSingleObject failed"));
                }
            }
            else if (::GetLastError() != ERROR_PIPE_CONNECTED)
            {
                ::CloseHandle(overlapped.hEvent);
                boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: ConnectNamedPipe failed"));
            }
        }
        ::CloseHandle(overlapped.hEvent);
# else
        if (!::CreatePipe(&hs[0], &hs[1], &sa, 0))
            boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category, "boost::process::detail::pipe::pipe: CreatePipe failed"));
# endif

________________________________

This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net