Run-Time Library Reference system, _wsystem
来源:互联网 发布:linux crontab php 编辑:程序博客网 时间:2024/05/17 22:37
Run-Time Library Reference |
Execute a command.
int system( const char *command );int _wsystem( const wchar_t *command );
Parameter
- command
- Command to be executed.
Return Value
If command is NULL and the command interpreter is found, returns a nonzero value. If the command interpreter is not found, returns 0 and sets errno to ENOENT. If command is not NULL, system returns the value that is returned by the command interpreter. It returns the value 0 only if the command interpreter returns the value 0. A return value of – 1 indicates an error, and errno is set to one of the following values:
- E2BIG
- Argument list (which is system dependent) is too big.
- ENOENT
- Command interpreter cannot be found.
- ENOEXEC
- Command-interpreter file has invalid format and is not executable.
- ENOMEM
- Not enough memory is available to execute command; or available memory has been corrupted; or invalid block exists, indicating that process making call was not allocated properly.
See _doserrno, errno, _sys_errlist, and _sys_nerr for more information on these, and other, return codes.
Remarks
The system function passes command to the command interpreter, which executes the string as an operating-system command. system refers to the COMSPEC and PATH environment variables that locate the command-interpreter file (the file named CMD.EXE in Windows NT). If command is NULL, the function simply checks to see whether the command interpreter exists.
You must explicitly flush (using fflush or _flushall) or close any stream before calling system.
_wsystem is a wide-character version of system; the command argument to _wsystem is a wide-character string. These functions behave identically otherwise.
Generic-Text Routine Mappings
TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined _tsystem system system _wsystem Requirements
Routine Required header Compatibility system <process.h> or <stdlib.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP _wsystem <process.h> or <stdlib.h> or <wchar.h> Win NT, Win 2000, Win XP Libraries
All versions of the C run-time libraries.
Example
This program uses system to TYPE a text file.
// crt_system.c#include <process.h>int main( void ){ system( "type crt_system.txt" );}
Input: crt_system.txt
Line one.Line two.
Output
Line one.Line two.
- Run-Time Library Reference system, _wsystem
- C Run-time library
- Run-Time Library
- Run-Time Library
- C run-time library
- C run-time library
- Run Time Library & win32 API
- CRT (C run-time library)
- CRT (C run-time library)
- CRT (C run-time library)
- Run-time system与虚拟机
- JVM Run-Time Data Areas--reference
- memset, wmemset Run-Time Library Referenc
- 如何理解C run-time library
- 如何理解C run-time library
- 如何理解C run-time library
- Use run-time library 设置问题
- C Run-Time Library的理解
- 界面测试的方法要点
- 软件测试的现实和理想
- 网页制作常用代码
- 巧妇难为无米之炊 走出软件测试的困境
- 软件测试过程的持续完善
- Run-Time Library Reference system, _wsystem
- 一段你永远无法知道其运行时间上限的代码
- jBPM的令牌/信令技术
- 开张了!!!
- 关于成熟
- 微软Windows XP SE泰国首卖 欲借此打盗版
- 优秀it书籍100本
- 【NEWS】Lancaster University leads European software project.
- 一边编程一边阅读Blog-Eclipse Rss Reader