1 Star 0 Fork 0

杨谨徽 / 代码托管

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cat.c 380 Bytes
一键复制 编辑 原始数据 按行查看 历史
杨谨徽 提交于 2023-09-28 12:36 . add cat.c.
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#define BLKSIZE 4096
int main(int argc, char *argv [ ])
{
int fd, i, m, n;
char buf[BLKSIZE],dummy;
fd = 0;
if(argc > 1){
fd = open(argv[1],O_RDONLY);
if(fd < 0) exit(1);
}
while(n = read(fd,buf,BLKSIZE)){
m = write(1,buf,n);
}
}
1
https://gitee.com/SHIBATORI/code-hosting.git
git@gitee.com:SHIBATORI/code-hosting.git
SHIBATORI
code-hosting
代码托管
master

搜索帮助