C++ Boost.Process 在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1683665/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 20:53:46  来源:igfitidea点击:

Where is Boost.Process?

c++boostcross-platformplatform-independentboost-process

提问by TC.

I need to execute a program and retrieve its stdout output in c++. I'd like my code to be cross-platform too.

我需要执行一个程序并在 C++ 中检索它的 stdout 输出。我也希望我的代码是跨平台的。

Having recently discovered the wonderful world of the Boost c++ libraries for all your cross platform needs, I figured I'd just go to boost.org and read up on the documentation of Boost.Process. Much to my surprise, it wasn't there! I then proceeded to figure out what name Boost gave their cross-platform library to start external processes, but haven't managed to find it so far.

最近发现了 Boost c++ 库的美妙世界,可以满足您所有的跨平台需求,我想我应该去 boost.org 并阅读 Boost.Process 的文档。令我惊讶的是,它不在那里!然后我开始弄清楚 Boost 给他们的跨平台库起什么名字来启动外部进程,但到目前为止还没有找到。

A Google search brought me to Julio M. Merino Vidal's Boost.Process, which seems to be the unofficial Boost library I was looking for. Strangely enough, I cannot seem to find a download link on that website. It also seems like there haven't been any recent developments regarding the project.

Google 搜索将我带到了 Julio M. Merino Vidal 的Boost.Process,这似乎是我正在寻找的非官方 Boost 库。奇怪的是,我似乎无法在该网站上找到下载链接。似乎该项目最近也没有任何进展。

I was finally able to find a download link for Vidal's Boost.Process on an external siteand will use that for now, but I'm quite amazed at the effort I had to put in to get my hands on a cross platform c++ library to interact with external processes.

我终于能够在外部站点上找到 Vidal 的 Boost.Process 的下载链接,现在将使用该链接,但我为获得跨平台 C++ 库而付出的努力感到非常惊讶与外部进程交互。

So, why is there no official Boost.Process? It seems like it would be a very valuable addition. Or am I totally overlooking the obvious solution here? Could you perhaps suggest other cross-platform libraries for managing simple starting of and interation with external processes?

那么,为什么没有官方的 Boost.Process 呢?看起来这将是一个非常有价值的补充。还是我完全忽略了这里明显的解决方案?您能否建议其他跨平台库来管理外部进程的简单启动和交互?

采纳答案by éric Malenfant

Julio M. Merino Vidal, who is, I beleive, the original author, wrote in this 2007 postthat he did not have time to complete it.

我相信,原作者 Julio M. Merino Vidal 在2007 年的这篇文章中写道,他没有时间完成它。

Development was taken over by Boris Schaeling. This is the version that you found at http://www.highscore.de/boost/process/. According to this post, he is still actively developing it.

开发由鲍里斯·谢林接管。这是您在http://www.highscore.de/boost/process/ 上找到的版本。根据这篇文章,他仍在积极开发它。

There is another version, by Ilya Sokolov.

还有另一个版本,作者是Ilya Sokolov

For your other question:

对于您的另一个问题:

Could you perhaps suggest other cross-platform libraries for managing simple starting of and interation with external processes?

您能否建议其他跨平台库来管理外部进程的简单启动和交互?

you could look at this wiki pagelisting alternatives.

您可以查看此 wiki 页面列出替代方案。

Depending on your needs, popen() could also do the job.

根据您的需要, popen() 也可以完成这项工作。

回答by alfC

Boost.Process was accepted for inclusion into Boost on November 9, 2016; and has been included in the 1.64released on April 19, 2017. Boost.Process is now an official Boost library!

Boost.Process 于2016 年 11 月 9 日接受纳入 Boost;并已包含在2017 年 4 月 19 日发布的 1.64 中。Boost.Process 现在是官方的 Boost 库!

It's documentation is available here: http://www.boost.org/doc/libs/1_64_0/doc/html/process.html

它的文档可以在这里找到:http: //www.boost.org/doc/libs/1_64_0/doc/html/process.html



For the record, the sources that were reviewed from October 27, 2016 through November 5, 2016 are available on GitHub:

作为记录,GitHub 上提供了从 2016 年 10 月 27 日到 2016 年 11 月 5 日过的来源:

download: https://github.com/klemens-morgenstern/boost-process

下载:https: //github.com/klemens-morgenstern/boost-process

manual: http://klemens-morgenstern.github.io/process/index.html

手册:http: //klemens-morgenstern.github.io/process/index.html



You can find on the web several older versions of this library. They are all more or less incompatible:

你可以在网上找到这个库的几个旧版本。它们都或多或少不兼容:

  • Version 0.5 (latest, as of 3rd Dec 2012)
  • 版本 0.5(最新,截至 2012 年 12 月 3 日)

download: http://www.highscore.de/boost/process0.5/process.zip

下载:http: //www.highscore.de/boost/process0.5/process.zip

manual: http://www.highscore.de/boost/process0.5/index.html

手册:http: //www.highscore.de/boost/process0.5/index.html

  • Version GSOC2010
  • 版本 GSOC2010

download: http://www.highscore.de/boost/gsoc2010/process.zip

下载:http: //www.highscore.de/boost/gsoc2010/process.zip

manual: http://www.highscore.de/boost/gsoc2010/

手册:http: //www.highscore.de/boost/gsoc2010/

  • Version 0.31
  • 版本 0.31

download: http://www.highscore.de/boost/process.zip

下载:http: //www.highscore.de/boost/process.zip

manual1: http://www.highscore.de/boost/process/

手册 1:http://www.highscore.de/boost/process/

manual2: http://www.highscore.de/cpp/process/

手册2:http://www.highscore.de/cpp/process/

I think it is the same as in http://svn.boost.org/svn/boost/sandbox/process/boost/

我认为它与http://svn.boost.org/svn/boost/sandbox/process/boost/ 中的相同

  • I.S. Version 0.1-0.4
  • IS 版本 0.1-0.4

download: https://github.com/boost-vault/Process

下载:https: //github.com/boost-vault/Process

  • Version 0?
  • 版本0?

download: http://www.netbsd.org/~jmmv/process.zip

下载:http: //www.netbsd.org/~jmmv/process.zip

manual: http://www.netbsd.org/~jmmv/process/

手册:http: //www.netbsd.org/~jmmv/process/

There are other version that look like branches: https://github.com/JeffFlinn/boost-processand https://github.com/boost-vault/Process.

还有其他看起来像分支的版本:https://github.com/JeffFlinn/boost-processhttps://github.com/boost-vault/Process

For a partial history of the project, look at http://www.highscore.de/cpp/process/#introduction

有关该项目的部分历史,请查看http://www.highscore.de/cpp/process/#introduction

回答by Daniel Trebbien

Boost Process was one of the Google Summer of Code projects this year. The GSOC 2010 Boost Process website is http://www.highscore.de/boost/gsoc2010/.

Boost Process 是今年 Google Summer of Code 项目之一。GSOC 2010 Boost Process 网站是http://www.highscore.de/boost/gsoc2010/

The library is still unofficial, but its developers feel that it is stable enough to request formal review.

该库仍然是非官方的,但其开发人员认为它足够稳定,可以申请正式

回答by Philipp Aumayr

As of August 18th 2012, a newer version of Boost.Process (v0.5) has been released at http://www.highscore.de/boost/process0.5/

截至 2012 年 8 月 18 日,更新版本的 Boost.Process (v0.5) 已在http://www.highscore.de/boost/process0.5/ 上发布

hope that helps, Philipp

希望有帮助,菲利普

回答by Georg Fritzsche

Another option might be the modularly designed POCO, see Process::launch()which has an overload that takes Pipesfor in, outand error.

另一种选择可能是模块化设计的POCO,看看Process::launch()哪个有一个重载,将Pipes用于输入输出错误

回答by Timo Geusch

It looks like Boost.Process is in the sandbox area, which would suggest that it has been proposed for inclusion and is probably still being work on, but hasn't been deemed stable, documented and/or useful enough to be included in the main boost release.

看起来 Boost.Process 位于沙盒区域,这表明它已被提议包含并且可能仍在开发中,但尚未被认为是稳定的、文档化的和/或足够有用以包含在主要促进释放。

回答by firegurafiku

For July 2015 it seems like Boost.Processhas been scheduledfor the Boost formal review again.

2015 年 7 月,似乎Boost.Process安排再次进行 Boost 正式。

回答by Pietro

The new Boost Process is now in beta and will be available in Boost 1.64.0.

新的 Boost Process 现在处于测试阶段,将在 Boost 1.64.0 中可用。

http://www.boost.org/doc/libs/1_64_0_b2/doc/html/process.html

http://www.boost.org/doc/libs/1_64_0_b2/doc/html/process.html

回答by Kirill V. Lyadvinsky

Parts of Boost.Process are available in several stand-alone libraries in Boost now: Boost.Interprocess, Program Options, etc.

Boost.Process 的部分内容现在可以在 Boost 的几个独立库中使用:Boost.Interprocess、Program Options 等。