|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.catacombae.jfuse.FUSE26FileSystemAdapter
org.catacombae.jfuse.FUSEFileSystemAdapter
org.catacombae.jfuse.MacFUSE20FileSystemAdapter
org.catacombae.jfuse.MacFUSEFileSystemAdapter
org.catacombae.jfuse.test.TestFS
public class TestFS
In-memory file system for testing jFUSE.
This file system will be used for testing jFUSE. All or most of the
FUSEOperations will be implemented in this file system eventually.
(Current status is work-in-progress.)
Field Summary |
---|
Fields inherited from interface org.catacombae.jfuse.types.system.FileStatusFlags |
---|
O_ACCMODE, O_APPEND, O_ASYNC, O_CREAT, O_DIRECTORY, O_EVTONLY, O_EXCL, O_EXLOCK, O_NOCTTY, O_NOFOLLOW, O_NONBLOCK, O_RDONLY, O_RDWR, O_SHLOCK, O_SYMLINK, O_SYNC, O_TRUNC, O_WRONLY |
Fields inherited from interface org.catacombae.jfuse.types.system.FileModeFlags |
---|
S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFREG, S_IFSOCK, S_IRGRP, S_IROTH, S_IRUSR, S_IRWXG, S_IRWXO, S_IRWXU, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR |
Fields inherited from interface org.catacombae.jfuse.FUSEErrorValues |
---|
E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, EAFNOSUPPORT, EAGAIN, EALREADY, EBADF, EBADMSG, EBUSY, ECANCELED, ECHILD, ECONNABORTED, ECONNREFUSED, ECONNRESET, EDEADLK, EDESTADDRREQ, EDOM, EDQUOT, EEXIST, EFAULT, EFBIG, EHOSTDOWN, EHOSTUNREACH, EIDRM, EILSEQ, EINPROGRESS, EINTR, EINVAL, EIO, EISCONN, EISDIR, ELOOP, EMFILE, EMLINK, EMSGSIZE, EMULTIHOP, ENAMETOOLONG, ENETDOWN, ENETRESET, ENETUNREACH, ENFILE, ENOBUFS, ENODEV, ENOENT, ENOEXEC, ENOLCK, ENOLINK, ENOMEM, ENOMSG, ENOPROTOOPT, ENOSPC, ENOSYS, ENOTBLK, ENOTCONN, ENOTDIR, ENOTEMPTY, ENOTSOCK, ENOTSUP, ENOTTY, ENXIO, EOPNOTSUPP, EOVERFLOW, EPERM, EPFNOSUPPORT, EPIPE, EPROTO, EPROTONOSUPPORT, EPROTOTYPE, ERANGE, EREMOTE, EROFS, ESHUTDOWN, ESOCKTNOSUPPORT, ESPIPE, ESRCH, ESTALE, ETIMEDOUT, ETOOMANYREFS, ETXTBSY, EUSERS, EWOULDBLOCK, EXDEV |
Constructor Summary | |
---|---|
TestFS()
|
Method Summary | |
---|---|
int |
chflags(ByteBuffer path,
int flags)
Change file flags. |
int |
chmod(ByteBuffer path,
short newMode)
Change the permission bits of a file. |
int |
create(ByteBuffer path,
short mode,
FUSEFileInfo fi)
Create and open a file. |
void |
destroy(Object o)
Clean up filesystem. |
int |
getattr(ByteBuffer path,
Stat stbuf)
Get file attributes. |
int |
getxtimes(ByteBuffer path,
Timespec bkuptime,
Timespec crtime)
Get the Mac OS X extended time values "backup time" and "create time". |
Object |
init(FUSEConnInfo conn)
Initialize filesystem. |
static void |
main(String[] args)
|
int |
mkdir(ByteBuffer path,
short mode)
Create a directory. |
int |
open(ByteBuffer path,
FUSEFileInfo fi)
File open operation. |
int |
read(ByteBuffer path,
ByteBuffer buf,
long offset,
FUSEFileInfo fi)
Read data from an open file. |
int |
readdir(ByteBuffer path,
FUSEFillDir filler,
long offset,
FUSEFileInfo fi)
Read directory. |
int |
readlink(ByteBuffer path,
ByteBuffer buffer)
Read the target of a symbolic link. |
int |
rename(ByteBuffer oldPath,
ByteBuffer newPath)
Rename a file. |
int |
rmdir(ByteBuffer path)
Remove a directory. |
int |
setbkuptime(ByteBuffer path,
Timespec tv)
Set the Mac OS X extended time value "backup time". |
int |
setcrtime(ByteBuffer path,
Timespec tv)
Set the Mac OS X extended time value "create time". |
int |
symlink(ByteBuffer source,
ByteBuffer dest)
Create a symbolic link. |
int |
truncate(ByteBuffer path,
long newSize)
Change the size of a file. |
int |
unlink(ByteBuffer path)
Remove a file. |
int |
utimens(ByteBuffer path,
Timespec accessTime,
Timespec modificationTime)
Change the access and modification times of a file with nanosecond resolution. |
int |
write(ByteBuffer path,
ByteBuffer buf,
long offset,
FUSEFileInfo fi)
Write data to an open file. |
Methods inherited from class org.catacombae.jfuse.MacFUSE20FileSystemAdapter |
---|
exchange, fsetattr_x, getMacFUSECapabilities, setattr_x |
Methods inherited from class org.catacombae.jfuse.FUSE26FileSystemAdapter |
---|
access, bmap, chown, fgetattr, flush, fsync, fsyncdir, ftruncate, getdir, getFUSECapabilities, getxattr_BSD, getxattr, link, listxattr, lock, mknod, opendir, release, releasedir, removexattr, setxattr_BSD, setxattr, statfs, utime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestFS()
Method Detail |
---|
public Object init(FUSEConnInfo conn)
FUSE26Operations
Initialize filesystem. The return value will passed in the private_data field of fuse_context to all file operations and as a parameter to the destroy() method. Introduced in version 2.3 Changed in version 2.6
init
in interface FUSE26Operations
init
in class FUSE26FileSystemAdapter
conn
- (struct fuse_conn_info*)
public void destroy(Object o)
FUSE26Operations
Clean up filesystem. Called on filesystem exit. Introduced in version 2.3
destroy
in interface FUSE26Operations
destroy
in class FUSE26FileSystemAdapter
public int getattr(ByteBuffer path, Stat stbuf)
FUSE26Operations
Get file attributes. Similar 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 FUSE26Operations
getattr
in class FUSE26FileSystemAdapter
path
- (const char*)stbuf
- (struct stat*)
public int chmod(ByteBuffer path, short newMode)
FUSE26Operations
Change the permission bits of a file.
chmod
in interface FUSE26Operations
chmod
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.newMode
- (mode_t)
public int readdir(ByteBuffer path, FUSEFillDir filler, long offset, FUSEFileInfo fi)
FUSE26Operations
Read directory. This 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'. Introduced in version 2.3
readdir
in interface FUSE26Operations
readdir
in class FUSE26FileSystemAdapter
path
- (const char*)filler
- (fuse_fill_dir_t)offset
- (off_t)fi
- (struct fuse_file_info*)
public int readlink(ByteBuffer path, ByteBuffer buffer)
FUSE26Operations
Read the target of a symbolic link. The buffer should be filled with a null terminated string. The buffer size argument includes the space for the terminating null character. If the linkname is too long to fit in the buffer, it should be truncated. The return value should be 0 for success.In jFUSE the buffer size argument has already been parsed when this method gets the buffer. The byte array passed to readlink has a size equal to the size of the native buffer.
readlink
in interface FUSE26Operations
readlink
in class FUSE26FileSystemAdapter
path
- (const char*)buffer
- (char*)
public int symlink(ByteBuffer source, ByteBuffer dest)
FUSE26Operations
Create a symbolic link.
symlink
in interface FUSE26Operations
symlink
in class FUSE26FileSystemAdapter
source
- (const char*)dest
- (const char*)
public int open(ByteBuffer path, FUSEFileInfo fi)
FUSE26Operations
File open operation. No creation, or truncation flags (O_CREAT, O_EXCL, O_TRUNC) will be passed to open(). 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. Changed in version 2.2
open
in interface FUSE26Operations
open
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.fi
- (struct fuse_file_info*)
public int create(ByteBuffer path, short mode, FUSEFileInfo fi)
FUSE26Operations
Create and open a file. If the file does not exist, first create it with the specified mode, and then open it. If this method is not implemented or under Linux kernel versions earlier than 2.6.15, the mknod() and open() methods will be called instead. Introduced in version 2.5
create
in interface FUSE26Operations
create
in class FUSE26FileSystemAdapter
path
- (const char*) path to the newly created file.mode
- (mode_t) the mode flags for the created file.fi
- (struct fuse_file_info*)
public int unlink(ByteBuffer path)
FUSE26Operations
Remove a file.
unlink
in interface FUSE26Operations
unlink
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.
public int truncate(ByteBuffer path, long newSize)
FUSE26Operations
Change the size of a file.
truncate
in interface FUSE26Operations
truncate
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.newSize
- (off_t)
public int utimens(ByteBuffer path, Timespec accessTime, Timespec modificationTime)
FUSE26Operations
Change the access and modification times of a file with nanosecond resolution. Introduced in version 2.6
utimens
in interface FUSE26Operations
utimens
in class FUSE26FileSystemAdapter
path
- (const char*)accessTime
- (const struct timespec)modificationTime
- (const struct timespec)
public int mkdir(ByteBuffer path, short mode)
FUSE26Operations
Create a directory.
mkdir
in interface FUSE26Operations
mkdir
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.mode
- (mode_t)
public int rmdir(ByteBuffer path)
FUSE26Operations
Remove a directory.
rmdir
in interface FUSE26Operations
rmdir
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.
public int rename(ByteBuffer oldPath, ByteBuffer newPath)
FUSE26Operations
Rename a file.
rename
in interface FUSE26Operations
rename
in class FUSE26FileSystemAdapter
oldPath
- (const char*)newPath
- (const char*)
public int read(ByteBuffer path, ByteBuffer buf, long offset, FUSEFileInfo fi)
FUSE26Operations
Read data from an open file. Read 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. Changed in version 2.2
read
in interface FUSE26Operations
read
in class FUSE26FileSystemAdapter
path
- (const char*) a path to the file to read from.buf
- (char*) the destination buffer.offset
- (off_t) offset in file to start reading.fi
- (struct fuse_file_info*) file info.
FUSEErrorValues
if an error occurred.public int write(ByteBuffer path, ByteBuffer buf, long offset, FUSEFileInfo fi)
FUSE26Operations
Write data to an open file. Write should return exactly the number of bytes requested except on error. An exception to this is when the 'direct_io' mount option is specified (see read operation). Changed in version 2.2
write
in interface FUSE26Operations
write
in class FUSE26FileSystemAdapter
path
- (const char*) the path to the file system node on
which the operation is to be applied.buf
- (const char*) the data to write.offset
- (off_t) offset in file where data should be written.fi
- (struct fuse_file_info*)
public int getxtimes(ByteBuffer path, Timespec bkuptime, Timespec crtime)
MacFUSE20Operations
getxtimes
in interface MacFUSE20Operations
getxtimes
in class MacFUSE20FileSystemAdapter
path
- (const char*)bkuptime
- (struct timespec*)crtime
- (struct timespec*)
public int setbkuptime(ByteBuffer path, Timespec tv)
MacFUSE20Operations
setbkuptime
in interface MacFUSE20Operations
setbkuptime
in class MacFUSE20FileSystemAdapter
path
- (const char*)tv
- (const struct timespec*)
public int setcrtime(ByteBuffer path, Timespec tv)
MacFUSE20Operations
setcrtime
in interface MacFUSE20Operations
setcrtime
in class MacFUSE20FileSystemAdapter
path
- (const char*)tv
- (const struct timespec*)
public int chflags(ByteBuffer path, int flags)
MacFUSE20Operations
chflags
in interface MacFUSE20Operations
chflags
in class MacFUSE20FileSystemAdapter
path
- (const char*)flags
- (uint32_t)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |