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
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
相关文章推荐
- Standard Input and Output Redirection
- Redirecting standard input and output
- C Standard Library: Character Input and Output Functions
- C Standard Library: Direct Input and Output Functions
- C Standard Library: 1 Input and Output: <stdio.h>
- [quote] standard Input and Output Redirection
- crontab 不能开启,且报错`/var/run.bak/crond.pid': Input/output error
- 20060801-Spatial transformations: Controlling the input and output grids with imtransform
- [VirtualBox] Install Ubuntu 14.10 error 5 Input/output error
- python2.7出现IOError: [Errno 5] Input/output error
- Lua标准库 - 输入输出处理(input and output facilities)
- Linux出现Input/output error
- Chapter 3 Introduction to Objects and Input/Output
- C++ - 格式化输入输出(formatted input and output) 的 详解 及 代码
- python3 使用pyaudio OSError: [Errno -9996] Invalid input device (no default output device)-ubuntu16.04
- unity, shader input and output
- File Input and Output(1)
- 硬盘故障时无法关机:bash: /sbin/shutdown: Input/output error
- Spark之SparkStreaming-Input DStreams and Receivers
- aliyun ubuntu pstack无法使用的问题解决 crawl: Input/output error