ChinaUnix.net
相关文章推荐:

perl stderr stdout chinaunix

本帖最后由 shihyu 于 2010-09-16 07:24 编辑 [code]#include int main(int argc, char *argv[]) { printf("%d\n",stderr); printf("%d\n",stdin); printf("%d\n",stdout); return 0; } [/code]-1216576160 -1216576480 -1216576320 打印出來 stderr stdin stdout 值是怎麼出來嗎? 不是 0 1 2 ? 謝謝

by shihyu - C/C++ - 2010-09-16 18:02:22 阅读(4125) 回复(9)

stderrstdinstdout

相关讨论

像这两个例子: fprintf(stderr,“hello\n”); fprintf(stdout,“hello\n”); 这两个不是一样吗??合成一个不就行了!但是在错误输出的时候,一般都用stderr

by kanhfshiys - C/C++ - 2009-12-25 17:21:57 阅读(8862) 回复(11)

每次通过open打开文件,系统会赋予一个文件描述符给这个进程,通常都是通过文件描述符是否为 0 来判断文件是否正确打开。 如果有很多进程一起打开多个文件,我们知道 0 是文件描述符stdin的值。那么所有的进程都去stdin取数据,这系统可怎么控制啊? 这不乱了吗? --------------------------------------------------- 以上是我看关于I/O重定向后的迷惑。 通常我们 fd = open(文件,写/读),然后read需要指定描述符。一般都...

by lvscluster - C/C++ - 2009-05-29 10:07:11 阅读(3141) 回复(6)

[code] fprintf(stdout,"%s\n","test"); fprintf(stderr,"%s\n","test"); 这两句没有啥差别,都是打出test [/code]

by dxbh - C/C++ - 2008-06-27 10:27:15 阅读(5281) 回复(14)

看了书之后还是迷茫阿,各位对他们的理解是什么?

by unixbaby - C/C++ - 2004-03-08 12:22:42 阅读(11747) 回复(13)

stdin,stdout,stderr是FILE*,它们是什么时候被初始化的?初始化的具体语句是怎么的?stdin和stdout,stderr分别指向哪些硬件设备?它们都是指向/dev/tty吗?

by liubo1977 - C/C++ - 2011-09-17 21:15:26 阅读(5519) 回复(11)

需要在tcl中执行linux/win32命令,获得其stdout,stderr输出,和errno. 下面是我的一些尝试, 不行, 有高手说说看不? (bin) 3 % if [catch {exec "dir"} Chan] { > puts stdout "Sorry, ...\n" > } Sorry, ... (bin) 4 % get $Chan can not find channel named "couldn't execute "dir": no such file or directory" (bin) 5 % ===== bin) 5 % set x [split [dir] \n] { Volume in drive L is Library} { Volume Serial Number ...

by iamkey9 - Shell - 2009-04-16 09:47:18 阅读(5931) 回复(5)

恽 益群 ( [email=yunyiqun@cn.ibm.com?subject=Linux%20%E6%8A%80%E5%B7%A7%EF%BC%9A%E9%87%8D%E5%AE%9A%E5%90%91%20stderr%20%E5%92%8C%20stdout%20%E8%BE%93%E5%87%BA%E5%88%B0%20gdb%20%E7%AA%97%E5%8F%A3&cc=zoucl@cn.ibm.com]yunyiqun@cn.ibm.com[/email] ), 软件工程师, IBM 余 锦 ( [email=yujin@cn.ibm.com?subject=Linux%20%E6%8A%80%E5%B7%A7%EF%BC%9A%E9%87%8D%E5%AE%9A%E5%90%91%20stderr%20%E5%92%8C%20stdout%2...

by zcwuwei - Linux文档专区 - 2008-12-03 21:46:34 阅读(879) 回复(0)

#!/bin/ksh filedate=`date +"20%y%m%d"` myhost=`hostname` errlog=/tmp/fixmv/stdout.log exec 2>$errlog 1>&2 echo "error log will list here, if empty means there is no error log" cd /TFT/1IL/CHAR find ./ -mtime +4 -print|cut -c3-100|xargs -I {} mv {} /BKFILE/1IL/CHAR/$filedate cd /TFT/3IL/CHAR find ./ -mtime +4 -print|cut -c3-100|xargs -I {} mv {} /BKFILE/3IL/CHAR/$filedate cd /TFT/AT1/CHAR find ./ ...

by Nivek.cao - AIX文档中心 - 2008-08-19 11:16:01 阅读(1729) 回复(0)

str_err=`./xx 1>/dev/null` echo str_err 如果程序./xx有stderr输出,我想让str_err获得该输出,如何获得呢。

by linlone - Shell - 2005-09-23 23:56:31 阅读(1441) 回复(5)

编译一个.c文件输出stdoutstderr,同时把stderr重定向到文件,命令怎么写? 我想在makefile里实现如下功能: 编译一个.c文件时照常把stdoutstderr都输出,同时把stderr重定向到一个出错日志文件err.log里去 我查了“||”“tee”等都不能实现该功能,请问命令如何写?

by BetonArmEE - Shell - 2006-05-25 17:35:08 阅读(6339) 回复(12)