static int iconv_fgetattr(const char *path, struct stat *stbuf, struct fuse_file_info *fi) { struct iconv *ic = iconv_get(); char *newpath; int err = iconv_convpath(ic, path, &newpath, 0); if (!err) { err = fuse_fs_fgetattr(ic->next, newpath, stbuf, fi); free(newpath); } return err; }
static int subdir_fgetattr(const char *path, struct stat *stbuf, struct fuse_file_info *fi) { struct subdir *d = subdir_get(); char *newpath; int err = subdir_addpath(d, path, &newpath); if (!err) { err = fuse_fs_fgetattr(d->next, newpath, stbuf, fi); free(newpath); } return err; }
static int volicon_fgetattr(const char *path, struct stat *buf, struct fuse_file_info *fi) { int res = 0; if (volicon_is_icon_magic_file(path)) { memset((void *)buf, 0, sizeof(struct stat)); buf->st_mode = S_IFREG | 0444; buf->st_nlink = 1; buf->st_uid = volicon_get()->volicon_uid; buf->st_gid = 0; buf->st_size = volicon_get()->volicon_size; buf->st_atime = buf->st_ctime = buf->st_mtime = time(NULL); } else { res = fuse_fs_fgetattr(volicon_get()->next, path, buf, fi); } return res; }