文件描述符是一个打开的文件或数据流相关联的证书0-------stdin 标准输入1-------stdout 标准输出2-------stderr 标准错误# echo “this is a file” > file.txt //将this is a file 重定向到文件file.txt中# e...
分类:
其他好文 时间:
2015-06-05 00:33:26
阅读次数:
123
1、符号>>用来定向输出。>>> import sys>>> print >> sys.stderr,'Fatal error!'Fatal error!2、raw_input()内建函数读取标注输入,用户的输入是字符串类型,需要转为整型。1 >>> num=raw_input("Enter a n...
分类:
其他好文 时间:
2015-05-30 13:23:02
阅读次数:
90
一、 一个简单TCP回射服务端程序
#include "unp.h"
#define MAXLINE 1024
#define PORT 13
#define CONMAX 5
void err_sys(const char* s)
{
fprintf(stderr, "%s\n",s);
exit(1);
}
void str_echo(int connfd)
{
in...
分类:
其他好文 时间:
2015-05-29 15:49:18
阅读次数:
127
今天用hadoop HDFS连接获取文件目录的时候出错:
17:31:14,503 ERROR [STDERR] java.io.IOException: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Message missing required fields:...
分类:
其他好文 时间:
2015-05-29 12:11:02
阅读次数:
395
启动容器
core@localhost ~ $ docker run
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container
-a, --attach=[] Attach to STDIN, STDOUT or STDERR.
-c, --...
分类:
其他好文 时间:
2015-05-27 17:26:21
阅读次数:
256
#define SXLog(FORMAT, ...) fprintf(stderr,"file --\t%s\nline --\t%d\nmethd --\t%s\noutput --\t\n\n%s\n",[[[NSString stringWithUTF8String:__FILE__...
分类:
其他好文 时间:
2015-05-24 23:28:12
阅读次数:
263
http://blog.csdn.net/yrj/article/details/4924041、GCC的编译和安装2、预处理 #define 可以支持不定数量的参数。 例子如下: #define err(...) fprintf(stderr,__VA_ARGS__) err("%s,%d/r/n...
分类:
其他好文 时间:
2015-05-22 00:01:36
阅读次数:
322
#ifndef _LOGGING_H #define _LOGGING_H #define deg printf #ifdef ENABLE_TRACING #define ENTER() do { fprintf(stderr, "%s: ENTER\n", __FUNCTION__); } wh...
分类:
其他好文 时间:
2015-05-21 16:54:53
阅读次数:
95
assert宏的原型定义在中,其作用是假设它的条件返回错误,则终止程序运行,原型定义:#include void assert( int expression );assert的作用是现计算表达式 expression ,假设其值为假(即为0),那么它先向stderr打印一条出错信息,然后通过调用 ...
分类:
其他好文 时间:
2015-05-20 22:05:26
阅读次数:
125
一、一个简单的时间获取客户端
#include
#define MAXCON 50
#define MAXLINE 1024
#define PORT 13
void err_sys(const char* s)
{
fprintf(stderr, "%s\n",s);
exit(1);
}
int main(int argc, char** argv)
{
int s...
分类:
其他好文 时间:
2015-05-20 18:29:44
阅读次数:
181