nachos.kernel.filesys
Class FileSystemStub

java.lang.Object
  extended by nachos.kernel.filesys.FileSystem
      extended by nachos.kernel.filesys.FileSystemStub

 class FileSystemStub
extends FileSystem

This "filesystem stub" class implements a Nachos filesystem by simply passing the filesystem operations through to the native filesystem on the host platform. This is provided in case the multiprogramming and virtual memory assignments (which make use of the file system) are done before the file system assignment.


Field Summary
private static boolean BLOCKING_FILESYS
          Do filesystem operations cause the calling thread to block waiting for the operation to complete? Blocking is simulated by calling Scheduler.yield; more realistically, the thread would wait for an interrupt to inform it that the operation is complete.
 
Constructor Summary
protected FileSystemStub()
          Constructor is protected so that all creations are funneled through the init() factory method of the super class.
 
Method Summary
 boolean create(java.lang.String name, long initialSize)
          Create a new file with a specified name and size.
 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.
 boolean remove(java.lang.String name)
          Remove the file with the specified name.
 
Methods inherited from class nachos.kernel.filesys.FileSystem
init, list, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCKING_FILESYS

private static final boolean BLOCKING_FILESYS
Do filesystem operations cause the calling thread to block waiting for the operation to complete? Blocking is simulated by calling Scheduler.yield; more realistically, the thread would wait for an interrupt to inform it that the operation is complete.

See Also:
Constant Field Values
Constructor Detail

FileSystemStub

protected FileSystemStub()
Constructor is protected so that all creations are funneled through the init() factory method of the super class.

Method Detail

create

public boolean create(java.lang.String name,
                      long initialSize)
Create a new file with a specified name and size.

Specified by:
create in class FileSystem
Parameters:
name - The name of the file.
initialSize - The size of the file.
Returns:
true if the operation was successful, otherwise false.

open

public 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.

Specified by:
open in class FileSystem
Parameters:
name - The name of the file.
Returns:
An OpenFile object that provides access to the file contents, if the file was successfully opened, otherwise null.

remove

public boolean remove(java.lang.String name)
Remove the file with the specified name.

Specified by:
remove in class FileSystem
Parameters:
name - The name of the file.
Returns:
true if the operation was successful, otherwise false.