Linux文件系统编程 系统调用 打开读取写入文件

#include <stdio.h> #include <errno.h> int main() { close(1); // 打开一个文件 int fd = open ("test.txt", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IXUSR); //int fd = open ("test.txt", O_RDONLY); if (fd == -1)
相关文章
相关标签/搜索