QProcess::finished ( int exitCode, QProcess::ExitStatus exitStatus ) : exitcode 的可能值?
我正在使用 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何适合
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.