Cmd.hpp
1 //
2 // Created by xiong on 2022/6/9.
3 //
4 
5 #ifndef EMX_Cmd_HPP
6 #define EMX_Cmd_HPP
7 
8 #include "core/EmxTypeDef.hpp"
9 
10 namespace Emx {
16  class Cmd {
17  public:
18 
25  static ErrCodeE Run(const char *cmd, ...);
26 
34  static ErrCodeE RunCheck(const char *cmd, ...);
35 
42  static ErrCodeE System(const char *cmd, ...);
43 
50  static ErrCodeE VforkRun(const char *cmd, ...);
51  };
53 }
54 
55 #endif //EMX_Cmd_HPP
执行外部命令
Definition: Cmd.hpp:16
static ErrCodeE Run(const char *cmd,...)
使用popen的方式执行命令,支持格式化字符串输入
static ErrCodeE System(const char *cmd,...)
使用psystem的方式执行命令,支持格式化字符串输入
static ErrCodeE RunCheck(const char *cmd,...)
使用popen的方式执行命令,支持格式化字符串输入, 并且会检测命令的执行结果是否返回0
static ErrCodeE VforkRun(const char *cmd,...)
使用vfork()的方式执行命令,支持格式化字符串输入
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10