#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
int main (int argc, char* argv[])
{
char* filename = argv[1];
/* Open the file for writing. If it exists, append to it;
otherwise, create a new file. */
int fd = open (filename, O_RDONLY | O_CREAT | O_APPEND, 0666);
// Reading file probleme
close (fd);
return 0;
}
我的問題是,我真的找不到如何讀取緩衝區。我只在文件中輸入內容,但是如何從中讀取到該緩衝區?我找不到實現該功能的功能。低級讀取文件
在我看來,你的問題將通過閱讀教程來解決。 – sashoalm
嘗試:'man 2 read' – asveikau