moss.fs
Class MFileSystem

java.lang.Object
  extended by moss.fs.MFileSystem

public class MFileSystem
extends java.lang.Object

this class handles file-system management. This is used to re-direct I/O requests to the right driver, etc.


Constructor Summary
MFileSystem()
           
 
Method Summary
static int access(java.lang.String path, int amode)
          tests for access to a file
static void finalinit()
          called to perform final initialisation (in the context of the init-task)
static void init_filesystem()
          initialises the file-system bits
static int mkdir(java.lang.String path, int flags)
          creates a directory in the file-system
static int mount(java.lang.String path, java.lang.String fstype, java.lang.String[] options)
          mounts a file-system
static int open(java.lang.String path, MFile handle, int flags, int mode)
          opens a file
static int opendir(java.lang.String path, MFile handle)
          opens a directory
static int stat(java.lang.String path, MInode statbuf)
          stats a file/directory
static int umount(java.lang.String path)
          unmounts a file-system
static int unlink(java.lang.String path)
          unlinks (removes) a file or directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFileSystem

public MFileSystem()
Method Detail

init_filesystem

public static void init_filesystem()
initialises the file-system bits


finalinit

public static void finalinit()
called to perform final initialisation (in the context of the init-task)


mount

public static int mount(java.lang.String path,
                        java.lang.String fstype,
                        java.lang.String[] options)
mounts a file-system

Parameters:
path - absolute path
fstype - file-system type
options - file-system specific options
Returns:
0 on success, < 0 on failure

umount

public static int umount(java.lang.String path)
unmounts a file-system

Parameters:
path - absolute path to the mounted file-system
Returns:
0 on success, or <0 indicating error

open

public static int open(java.lang.String path,
                       MFile handle,
                       int flags,
                       int mode)
opens a file

Parameters:
path - absolute path to the file
handle - file-handle that will be used for this file
flags - OPEN_READ / OPEN_WRITE / OPEN_CREAT
Returns:
0 on success, otherwise < 0 indicating error

opendir

public static int opendir(java.lang.String path,
                          MFile handle)
opens a directory

Parameters:
path - absolute path to the directory
handle - file-handle that will be used for this directory
Returns:
0 on success, otherwise < 0 indicating error

mkdir

public static int mkdir(java.lang.String path,
                        int flags)
creates a directory in the file-system

Parameters:
path - relative path to the directory to be created
flags - flags (mode)
Returns:
0 on success, or < 0 indicating error

stat

public static int stat(java.lang.String path,
                       MInode statbuf)
stats a file/directory

Parameters:
path - absolute path to the file/directory
statbuf - MInode where the information will be placed
Returns:
0 on success, otherwise < 0 indicating error

access

public static int access(java.lang.String path,
                         int amode)
tests for access to a file

Parameters:
path - absolute path to the file/directory
amode - access mode: bitwise-or of (MFileOps) F_OK, R_OK, W_OK and/or X_OK
Returns:
0 on success, otherwise < 0 indicating error

unlink

public static int unlink(java.lang.String path)
unlinks (removes) a file or directory

Parameters:
path - absolute path to the file/directory
Returns:
0 on success, otherwise < 0 indicating error