您的位置:首页 > 编程语言 > PHP开发

Standard input, output, and error streams

2011-06-15 15:04 351 查看
Using the generic ARM C library, the standard input (stdin), output (stdout) and error streams (stderr) can be redirected at runtime. For example, if mycopy is a program, running on a host debugger, that copies the standard input to the standard output, the following line runs the program:

mycopy < infile > outfile 2> errfile

and redirects the files as follows:

stdin
The file is redirected to infile
stdout
The file is redirected to outfile
stderr
The file is redirected to errfile.

The permitted redirections are:
0< filename
This reads stdin from filename.
< filename
This reads stdin from filename.
1> filename
This writes stdout to filename.
> filename
This writes stdout to filename.
2> filename
This writes stderr to filename.
2>&1
This writes stderr to the same place as stdout.
>& file
This writes both stdout and stderr to filename.
>> filename
This appends stdout to filename.
>>& filename
This appends both stdout and stderr to filename.

//From ADS Compilers and Libraries Guide
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: