nachos.machine
Interface FileSystem

All Known Implementing Classes:
StubFileSystem

public interface FileSystem

A file system that allows the user to create, open, and delete files.


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.
 

Method Detail

open

public OpenFile open(String name,
                     boolean create)
Atomically open a file, optionally creating it if it does not already exist.
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)
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.
Parameters:
name - the name of the file to remove.
Returns:
true if the file was successfully removed.