public class HelloFuse extends FuseStubFS
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HELLO_PATH |
static java.lang.String |
HELLO_STR |
fuseOperations, libFuse, mounted, mountPoint| Constructor and Description |
|---|
HelloFuse() |
| Modifier and Type | Method and Description |
|---|---|
int |
getattr(java.lang.String path,
FileStat stat)
Get file attributes.
|
static void |
main(java.lang.String[] args) |
int |
open(java.lang.String path,
FuseFileInfo fi)
File open operation
|
int |
read(java.lang.String path,
jnr.ffi.Pointer buf,
long size,
long offset,
FuseFileInfo fi)
Read data from an open file
|
int |
readdir(java.lang.String path,
jnr.ffi.Pointer buf,
FuseFillDir filter,
long offset,
FuseFileInfo fi)
Read directory
|
access, bmap, chmod, chown, create, destroy, fallocate, fgetattr, flock, flush, fsync, fsyncdir, ftruncate, getxattr, init, ioctl, link, listxattr, lock, mkdir, mknod, opendir, poll, read_buf, readlink, release, releasedir, removexattr, rename, rmdir, setxattr, statfs, symlink, truncate, unlink, utimens, write_buf, writegetContext, getFSName, mount, umountpublic static final java.lang.String HELLO_PATH
public static final java.lang.String HELLO_STR
public int getattr(java.lang.String path,
FileStat stat)
FuseFSSimilar to stat(). The 'st_dev' and 'st_blksize' fields are ignored. The 'st_ino' field is ignored except if the 'use_ino' mount option is given.
getattr in interface FuseFSgetattr in class FuseStubFSpublic int readdir(java.lang.String path,
jnr.ffi.Pointer buf,
FuseFillDir filter,
long offset,
FuseFileInfo fi)
FuseFSThis supersedes the old getdir() interface. New applications should use this.
The filesystem may choose between two modes of operation:
1) The readdir implementation ignores the offset parameter, and passes zero to the filler function's offset. The filler function will not return '1' (unless an error happens), so the whole directory is read in a single readdir operation. This works just like the old getdir() method.
2) The readdir implementation keeps track of the offsets of the directory entries. It uses the offset parameter and always passes non-zero offset to the filler function. When the buffer is full (or an error happens) the filler function will return '1'.
readdir in interface FuseFSreaddir in class FuseStubFSpublic int open(java.lang.String path,
FuseFileInfo fi)
FuseFSNo creation (O_CREAT, O_EXCL) and by default also no truncation (O_TRUNC) flags will be passed to open(). If an application specifies O_TRUNC, fuse first calls truncate() and then open(). Only if 'atomic_o_trunc' has been specified and kernel version is 2.6.24 or later, O_TRUNC is passed on to open.
Unless the 'default_permissions' mount option is given, open should check if the operation is permitted for the given flags. Optionally open may also return an arbitrary filehandle in the fuse_file_info structure, which will be passed to all file operations.
open in interface FuseFSopen in class FuseStubFSOpenFlagspublic int read(java.lang.String path,
jnr.ffi.Pointer buf,
long size,
long offset,
FuseFileInfo fi)
FuseFSRead should return exactly the number of bytes requested except on EOF or error, otherwise the rest of the data will be substituted with zeroes. An exception to this is when the 'direct_io' mount option is specified, in which case the return value of the read system call will reflect the return value of this operation.
read in interface FuseFSread in class FuseStubFSpublic static void main(java.lang.String[] args)