fuse_operations

The file system operations:

Most of these should work very similarly to the well known UNIX file system operations. A major exception is that instead of returning an error in 'errno', the operation should return the negated error value (-errno) directly.

All methods are optional, but some are essential for a useful filesystem (e.g. getattr). Open, flush, release, fsync, opendir, releasedir, fsyncdir, access, create, ftruncate, fgetattr, lock, init and destroy are special purpose methods, without which a full featured filesystem can still be implemented.

Almost all operations take a path which can be of any length.

Changed in fuse 2.8.0 (regardless of API version) Previously, paths were limited to a length of PATH_MAX.

See http://fuse.sourceforge.net/wiki/ for more information. There is also a snapshot of the relevant wiki pages in the doc/ folder.

extern (C)
struct fuse_operations {}

Members

Variables

access
int function(const char*, int) access;

Check file access permissions

bmap
int function(const char*, size_t, uint64_t*) bmap;

Map block index within file to block index within device

chmod
int function(const char*, mode_t) chmod;

Change the permission bits of a file

chown
int function(const char*, uid_t, gid_t) chown;

Change the owner and group of a file

create
int function(const char*, mode_t, fuse_file_info*) create;

Create and open a file

destroy
void function(void*) destroy;

Clean up filesystem

fallocate
int function(const char*, int, off_t, off_t, fuse_file_info*) fallocate;

Allocates space for an open file

fgetattr
int function(const char*, stat_t*, fuse_file_info*) fgetattr;

Get attributes from an open file

flock
int function(const char*, fuse_file_info*, int op) flock;

Perform BSD file locking operation

flush
int function(const char*, fuse_file_info*) flush;

Possibly flush cached data

fsync
int function(const char*, int, fuse_file_info*) fsync;

Synchronize file contents

fsyncdir
int function(const char*, int, fuse_file_info*) fsyncdir;

Synchronize directory contents

ftruncate
int function(const char*, off_t, fuse_file_info*) ftruncate;

Change the size of an open file

getattr
int function(const char*, stat_t*) getattr;

Get file attributes.

getdir
int function(const char*, fuse_dirh_t, fuse_dirfil_t) getdir;
Undocumented in source.
getxattr
int function(const char*, char*, char*, size_t) getxattr;

Get extended attributes

init
void* function(fuse_conn_info* conn) init;

Initialize filesystem

ioctl
int function(const char*, int, void*, fuse_file_info*, uint, void*) ioctl;

Ioctl

link
int function(const char*, char*) link;

Create a hard link to a file

listxattr
int function(const char*, char*, size_t) listxattr;

List extended attributes

lock
int function(const char*, fuse_file_info*, int cmd, .flock*) lock;

Perform POSIX file locking operation

mkdir
int function(const char*, mode_t) mkdir;

Create a directory

mknod
int function(const char*, mode_t, dev_t) mknod;

Create a file node

open
int function(const char*, fuse_file_info*) open;

File open operation

opendir
int function(const char*, fuse_file_info*) opendir;

Open directory

poll
int function(const char*, fuse_file_info*, fuse_pollhandle*, uint*) poll;

Poll for IO readiness events

read
int function(const char*, char*, size_t, off_t, fuse_file_info*) read;

Read data from an open file

read_buf
int function(const char*, fuse_bufvec** bufp, size_t size, off_t off, fuse_file_info*) read_buf;

Store data from an open file in a buffer

readdir
int function(const char*, void*, fuse_fill_dir_t, off_t, fuse_file_info*) readdir;

Read directory

readlink
int function(const char*, char*, size_t) readlink;

Read the target of a symbolic link

release
int function(const char*, fuse_file_info*) release;

Release an open file

releasedir
int function(const char*, fuse_file_info*) releasedir;

Release directory

removexattr
int function(const char*, char*) removexattr;

Remove extended attributes

rename
int function(const char*, const char*) rename;

Rename a file

rmdir
int function(const char*) rmdir;

Remove a directory

setxattr
int function(const char*, char*, char*, size_t, int) setxattr;

Set extended attributes

statfs
int function(const char*, statvfs_t*) statfs;

Get file system statistics

symlink
int function(const char*, char*) symlink;

Create a symbolic link

truncate
int function(const char*, off_t) truncate;

Change the size of a file

unlink
int function(const char*) unlink;

Remove a file

utime
int function(const char*, utimbuf*) utime;

Change the access and/or modification times of a file

utimens
int function(const char*, const ref timespec[2]) utimens;

Change the access and modification times of a file with nanosecond resolution

write
int function(const char*, char*, size_t, off_t, fuse_file_info*) write;

Write data to an open file

write_buf
int function(const char*, fuse_bufvec*, off_t, fuse_file_info*) write_buf;

Write contents of buffer to an open file

Meta