public class File extends Object
Modifier and Type | Field and Description |
---|---|
static tijos.kernel.io.Disk1 |
disk |
static int |
filePageSize |
static byte |
MAX_FILES
Number of files the file system can store.
|
static byte |
totalFiles
The total number of files in the file system.
|
Constructor and Description |
---|
File(String name)
Creates a new File object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canRead() |
boolean |
canWrite() |
boolean |
createNewFile()
Creates a new file entry in the flash memory.
|
static void |
defrag()
Defrag the file system.
|
boolean |
delete()
Deletes the file represented by this File object.
|
boolean |
exists()
Indicates if the file exists in the flash memory.
|
static void |
format()
Essentially formats the file system by writing TABLE_ID characters to
the first page of flash memory.
|
static int |
freeMemory()
Returns to total free memory in the flash file system.
|
int |
getIndex()
Returns location of file in the files[] array
|
String |
getName()
Returns the name of the file.
|
int |
getPage()
Internal method used to get the page number of the start of the file.
|
boolean |
isHidden() |
long |
length()
Returns the length of the file denoted by this file name.
|
static File[] |
listFiles()
Returns a list of files in the flash file system.
|
void |
moveToTop()
Move the file to become the last one in flash memory.
|
static void |
reset()
Reset the files array after an error.
|
boolean |
setReadOnly() |
String |
toString() |
public static tijos.kernel.io.Disk1 disk
public static int filePageSize
public static final byte MAX_FILES
public static byte totalFiles
public File(String name) throws IOException
name
- IOException
public boolean canRead()
public boolean canWrite()
public boolean createNewFile() throws IOException
IOException
public static void defrag() throws IOException
IOException
public boolean delete()
public boolean exists()
public static void format() throws IOException
IOException
public static int freeMemory() throws IOException
IOException
public int getIndex()
public String getName()
public int getPage()
public boolean isHidden()
public long length()
public static File[] listFiles() throws IOException
IOException
public void moveToTop() throws IOException
IOException
public static void reset()
public boolean setReadOnly()