|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.filesys.FileSystem
public abstract class FileSystem
This abstract class defines the interface to a Nachos file system. A file system is a set of files stored on disk, organized into directories. Operations on the file system have to do with "naming" -- creating, opening, and deleting files, given a textual file name. Operations on an individual "open file" (read, write, close) are to be found in the OpenFile class (Openfile.java). We define two separate implementations of the file system: a "real" file system, built on top of a disk simulator, and a "stub" file system, which just re-defines the Nachos file system operations as operations on the native file system on the machine running the Nachos simulation.
Constructor Summary | |
---|---|
protected |
FileSystem()
Protected constructor to force creation of a filesystem using the init() factory method. |
Method Summary | |
---|---|
abstract boolean |
create(java.lang.String name,
long initialSize)
Create a new file with a specified name and size. |
static FileSystem |
init(java.lang.String[] args,
boolean stub)
Factory method to create the proper type of filesystem and hide the type actually being used. |
void |
list()
List contents of the filesystem directory (for debugging). |
abstract OpenFile |
open(java.lang.String name)
Open the file with the specified name and return an OpenFile object that provides access to the file contents. |
void |
print()
Print contents of the entire filesystem (for debugging). |
abstract boolean |
remove(java.lang.String name)
Remove the file with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FileSystem()
Method Detail |
---|
public abstract boolean create(java.lang.String name, long initialSize)
name
- The name of the file.initialSize
- The size of the file.
public abstract OpenFile open(java.lang.String name)
name
- The name of the file.
public abstract boolean remove(java.lang.String name)
name
- The name of the file.
public static FileSystem init(java.lang.String[] args, boolean stub)
args
- Command-line arguments, used to determine whether the
filesystem should be "formatted" after being initialized.stub
- True if we should be using the stub filesystem,
rather than the real filesystem.public void list()
public void print()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |