nachos.machine
Class StubFileSystem
java.lang.Object
|
+--nachos.machine.StubFileSystem
- public class StubFileSystem
- extends Object
- implements FileSystem
This class implements a file system that redirects all requests to the host
operating system's file system.
|
Method Summary |
OpenFile |
open(String name,
boolean create)
Atomically open a file, optionally creating it if it does not already
exist. |
boolean |
remove(String name)
Atomically remove an existing file. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
StubFileSystem
public StubFileSystem(Privilege privilege,
File directory)
- Allocate a new stub file system.
- Parameters:
privilege - encapsulates privileged access to the Nachos
machine.directory - the root directory of the stub file system.
open
public OpenFile open(String name,
boolean create)
- Description copied from interface: FileSystem
- Atomically open a file, optionally creating it if it does not already
exist.
- Specified by:
- open in interface FileSystem
- Tags copied from interface: FileSystem
- Parameters:
name - the name of the file to open.create - true to create the file if it does not already
exist, or truncate it to zero length if it does exist.- Returns:
- an OpenFile representing a new instance of the opened
file, or null if the file could not be opened.
remove
public boolean remove(String name)
- Description copied from interface: FileSystem
- Atomically remove an existing file. After a file is removed, it cannot
be opened until it is created again with create. If the file is
already open, it is up to the implementation to decide whether the file
can still be accessed or if it is deleted immediately.
- Specified by:
- remove in interface FileSystem
- Tags copied from interface: FileSystem
- Parameters:
name - the name of the file to remove.- Returns:
- true if the file was successfully removed.