D 和伪终端

发布于 2025-01-01 13:57:46 字数 109 浏览 3 评论 0原文

D 是否通过 Phobos 运行时库内置了对伪终端的支持?...我假设没有,因为 pty 是高度特定于平台的。还有其他第三方替代品吗?最终,我想为 D 实现一个类似 Expect 的库(如果它还不存在)。

Does D have built in support for pseudo-terminals via the Phobos runtime libraries ?...I'm assuming there isn't since ptys are highly platform specific. Are there other third party alternatives ? Ultimately, I'd like to implement an Expect-like library for D if it doesn't already exist.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

分開簡單 2025-01-08 13:57:46

如果“通过 Phobos 运行时支持伪终端”意味着底层操作系统支持的伪终端之上的一些更高级别的抽象,那么我必须说我从未见过这样的事情。与 C++ 一样,D 可以直接调用 C 函数,因此我相信,如果您已经在 C 或 C++ 中做过类似的事情,那么在 D 中编写类似 Expect 的应用程序应该不难。

在 Linux 上,人们通常调用 openpty(3)forkpty(3)login_tty(3) 函数。我不知道其他系统。

If by "support for pseudo-terminals via the Phobos runtime" you mean some higher level abstraction on top of the pseudo-terminals supported by the underlying operating-system, then I must say I have never seen such a thing. Like C++, D can directly call C functions, so I believe writing an expect-like application in D should not be difficult if you already did something similar in C or C++.

On Linux people typically call openpty(3), forkpty(3) or login_tty(3) functions. I do not know about other systems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文