FileSystem

Class with basic file operations for inheritance. Operation descriptions are taken from libfuse documentation with small modifications.

File operations are marked with @(null) attribute. It means that they are not implemented and the final operation functions will be null pointers. When overriding file operations, you should not use these attributes (see examples).

abstract
class FileSystem {}

Members

Functions

access
bool access(string path, int mode)

Check file access permissions.

bmap
void bmap(string path, size_t blocksize, ulong* idx)

Map block index within file to block index within device.

chmod
void chmod(string path, mode_t mode, ffi_t* fi)

Change the permission bits of a file.

chown
void chown(string path, uid_t uid, gid_t gid, ffi_t* fi)

Change the owner and group of a file.

copy_file_range
ssize_t copy_file_range(string path_in, ffi_t* fi_in, off_t offset_in, string path_out, ffi_t* fi_out, off_t offset_out, size_t size, int flags)

Copy a range of data from one file to another.

create
void create(string path, mode_t mode, ffi_t* fi)

Create and open a file.

destroy
void destroy()

Clean up filesystem.

fallocate
void fallocate(string path, int mode, off_t off, off_t len, ffi_t* fi)

Allocates space for an open file.

flock
void flock(string path, ffi_t* fi, int op)

Perform BSD file locking operation.

flush
void flush(string path, ffi_t* fi)

Possibly flush cached data.

fsync
void fsync(string path, int sync, ffi_t* fi)

Synchronize file contents.

fsyncdir
void fsyncdir(string path, int sync, ffi_t* fi)

Synchronize directory contents.

getMountPoint
string getMountPoint()

Returns current value of mount point path.

getattr
stat_t getattr(string path, ffi_t* fi)

Get file attributes.

getxattr
string getxattr(string p, string k)

Get extended attributes.

handleException
void handleException(Exception e)

Called for unknown exception cases (if errno is 0) during the execution of any file operation. The best thing to do is print the error.

handleFuseException
void handleFuseException(FuseException e)

Called for FuseException containg errno. It can be used for additional logging.

initialize
void initialize(fuse_conn_info* conn, fuse_config* cfg)

Initialize filesystem.

ioctl
void ioctl(string p, uint cmd, void* arg, ffi_t* fi, uint flags, void* data)

Ioctl.

link
void link(string src, string dst)

Create a hard link to a file.

listxattr
string[] listxattr(string path)

List extended attributes.

lock
void lock(string path, ffi_t* fi, int cmd, flock_t* flock)

Perform POSIX file locking operation.

lseek
off_t lseek(string path, off_t off, int whence, ffi_t* fi)

Find next data or hole after the specified offset.

mkdir
void mkdir(string path, mode_t mode)

Create a directory.

mknod
void mknod(string path, mode_t mode, dev_t dev)

Create a file node.

open
void open(string path, ffi_t* fi)

Open a file.

opendir
void opendir(string path, ffi_t* fi)

Open directory.

poll
void poll(string path, ffi_t* fi, fuse_pollhandle* ph, uint* reventsp)

Poll for IO readiness events.

read
int read(string path, ubyte* buff, size_t , off_t off, ffi_t* fi)

Read data from an open file.

readdir
string[] readdir(string path, ffi_t* fi)

Read directory.

readlink
string readlink(string path)

Read the target of a symbolic link.

release
void release(string path, ffi_t* fi)

Release an open file.

releasedir
void releasedir(string path, ffi_t* fi)

Release directory. Corrensponds to 'closedir' system call.

removexattr
void removexattr(string path, string key)

Remove extended attributes.

rename
void rename(string src, string dst, uint flags)

Rename a file.

rmdir
void rmdir(string path)

Remove a directory.

setMountPoint
void setMountPoint(string mountPoint)

Mount point is a part of an instance of a class that needs to be set before mounting.

setxattr
void setxattr(string path, string k, string v, int flags)

Set extended attributes.

statfs
statvfs_t statfs(string path)

Get file system statistics.

symlink
void symlink(string src, string dst)

Create a symbolic link.

truncate
void truncate(string path, off_t off, ffi_t* fi)

Change the size of a file.

unlink
void unlink(string path)

Remove a file (hard link).

utimens
void utimens(string path, const(timespec)[2] tv, ffi_t* fi)

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

write
int write(string path, ubyte* data, size_t size, off_t off, ffi_t* fi)

Write data to an open file.

Variables

mountPoint
string mountPoint;
Undocumented in source.

Meta