QProcess::finished ( int exitCode, QProcess::ExitStatus exitStatus ) : exitcode 的可能值?

发布于 2024-10-09 15:47:44 字数 132 浏览 3 评论 0原文

我正在使用 QProcess 执行 shell 命令。

如何判断命令执行成功?

ExitStatus 告诉进程正常退出或崩溃。

exitcode 的可能值有哪些? 我正在获取不同进程的变体退出代码。

I am using QProcess to execute shell commands.

How can I determine that command is executed successfully ?

ExitStatus tells that process exited normally or crashed.

What are the possible values of exitcode ?
I am getting variant exitcode for different process.

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

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

发布评论

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

评论(1

凤舞天涯 2024-10-16 15:47:44

任何适合 int 的退出代码都是可能的。

按照惯例,退出代码 0 表示“成功”,其他任何值表示“失败”。这适用于我所知道的所有操作系统,并且还有其他约定可以提供有关某些情况下错误的更多详细信息。 http://en.wikipedia.org/wiki/Exit_status 有一个概述

在实践中,您你会发现几乎所有具有 Unix 传统的程序都会正确遵循 0 的约定来成功,但某些 Windows 程序不会。由于两个操作系统之间的设计差异,退出代码在 Windows 上的使用往往不如在 Unix 上正确。

Any exit code which fits into int is possible.

By convention, an exit code of 0 means "success" and anything else means "failure". This works for all operating systems I know, and there are additional conventions to give more details about errors in some cases. There is an overview at http://en.wikipedia.org/wiki/Exit_status

In practice you will find that almost all programs with a Unix heritage will correctly follow the convention of 0 for success, but some Windows programs will not. Due to the design differences between the two OS, exit codes tend to be used less correctly on Windows than on Unix.

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