📄 test_scull.c
字号:
#vi test_scull.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int
main(void)
{
int fd, ret;
char *buf="a scull test";
char readbuf[16];
// write file
fd = open("/dev/scull", O_RDWR);
ret = write(fd, buf, strlen(buf)+1);
close(fd);
// read file
fd = open("/dev/scull", O_RDONLY);
read(fd, readbuf, ret);
printf("%s\n", readbuf);
close(fd);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -