- 博客(6)
- 资源 (2)
- 收藏
- 关注
原创 linux管道PIPE/FIFO
FIFO :命名管道作用:可用于没有亲缘进程之间的通信,是进程间通信的一种进程1:#include <unistd.h>#include <fcntl.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>...
2019-07-14 18:41:25
130
原创 opendir/stat/getcwd/chdir 详解与实例应用
代码#include <unistd.h>#include <fcntl.h>#include <dirent.h>#include <sys/types.h>#include <sys/stat.h>#include <stdio.h>#include <errno.h>#include &l...
2019-07-14 18:22:48
228
原创 ftruncate函数详解
代码实例:#include <unistd.h>#include <fcntl.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>extern int errno;#define ERR_EXIT(msg...
2019-07-14 16:02:16
2782
原创 fopen/open/lseek/fseek/fileno 函数详解
openint open(const char *pathname, int flags, mode_t mode);flags : O_CREAT :创建文件 O_EXCL :必须和O_CREAT一起使用,表示如果文件不存在就创建,如果文件存在就失败 O_APPEND:追加 O_RDWR O_RDONLY O_RWONLY注意:创建文件时,权限会受到uma...
2019-07-13 16:13:08
620
原创 scanf你不知道的那些用法
scanf int a,f; scanf("%2d%*2d%1d",&a,&f); printf("a=%d b=%%%d\n",a,f);运行:注释:%2d表示只接收2个字符,%*2d表示忽略2个字符,%1d表示只接收1个字符
2019-07-13 15:49:21
1485
原创 Linux C之打印(printf/fprintf/errno/strerrno/perror)
fprintf / strerror / errno#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <libgen.h>extern int errno;#define LOG_ERROR(msg) ...
2019-07-13 15:28:48
1436
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人