📄 program5.c
字号:
/*#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
main()
{
int fd;
int n;
int fdnum;
char buf[256];
mknod("fifo",S_IFIFO|0666,0);
fd = open("fifo",O_WRONLY);
fdnum = open("mywork",O_RDONLY);
//while((n=read(fdnum,buf,256))>0)
while(gets(buf)!=NULL)
{
write(fd,buf,256);
}
close(fd);
}*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
main()
{
int fd;
char buf[256];
mknod("fifo",S_IFIFO|0666,0);
fd = open("fifo",O_WRONLY);
while(gets(buf)!=NULL)
{
write(fd,buf,strlen(buf)+1);
}
close(fd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -