使用 fuse 编写文件系统 (2)

读写文件

在第一个程序的基础上增加读写 hello-world 的功能:

#define FUSE_USE_VERSION 26

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fuse.h>

#define BUFFSIZE 8192

static int content_size;
static char content[BUFFSIZE];
static const char* fname = "hello-world";

static int ou_readdir(const char* path, void* buf, fuse_fill_dir_t filler,
                      off_t 

阅读全文…