|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--moka.lang.Object | +--moka.io.IOStream | +--moka.io.File
An abstract representation of file and directory pathnames.
Field Summary | |
short |
mode
The file mode. |
static short |
MODE_APPEND
Append (binary); open for writing at end of file, or create for writing if the file does not exist. |
static short |
MODE_APPEND_TEXT
Append (text); open for writing at end of file, or create for writing if the file does not exist. |
static short |
MODE_OPEN_READ
Open for reading only (binary). |
static short |
MODE_OPEN_READ_TEXT
Open for reading only (text). |
static short |
MODE_OPEN_UPDATE
Open an existing file for update (reading and writing) (binary). |
static short |
MODE_OPEN_UPDATE_TEXT
Open an existing file for update (reading and writing) (text). |
static short |
MODE_UPDATE
Create a new file for update (reading and writing) (binary). |
static short |
MODE_UPDATE_APPEND
Open for append (binary); open for update at the end of the file, or create if the file does not exist. |
static short |
MODE_UPDATE_APPEND_TEXT
Open for append (text); open for update at the end of the file, or create if the file does not exist. |
static short |
MODE_UPDATE_TEXT
Create a new file for update (reading and writing) (text). |
static short |
MODE_WRITE
Create for writing (binary). |
static short |
MODE_WRITE_TEXT
Create for writing (text). |
java.lang.String |
name
The name of the file. |
java.lang.String |
type
The type of the file to appear in the VAR-LINK menu. |
Fields inherited from class moka.io.IOStream |
error, opened |
Constructor Summary | |
File(java.lang.String pathname)
Creates a new File instance by using the given pathname string. |
Method Summary | |
int |
available()
Returns the number of bytes that can be read from this file. |
void |
close()
Closes the stream. |
boolean |
delete()
Deletes the file denoted by this abstract pathname. |
boolean |
exists()
Tests whether the file denoted by this abstract pathname exists. |
static void |
export(java.lang.String name,
boolean b)
Exports the boolean argument to a TIOS variable. |
static void |
export(java.lang.String name,
byte b)
Exports the byte argument to a TIOS variable. |
static void |
export(java.lang.String name,
char c)
Exports the char argument to a TIOS variable. |
static void |
export(java.lang.String name,
double d)
Exports the double argument to a TIOS variable. |
static void |
export(java.lang.String name,
int i)
Exports the int argument to a TIOS variable. |
static void |
export(java.lang.String name,
long l)
Exports the long argument to a TIOS variable. |
static void |
export(java.lang.String name,
short s)
Exports the short argument to a TIOS variable. |
static void |
export(java.lang.String name,
java.lang.String s)
Exports the String argument to a TIOS variable. |
static void |
exportExpr(java.lang.String name,
java.lang.String expr)
Exports an expression to a TIOS variable. |
void |
finalize()
Frees the memory of system ressources used by this File object. |
boolean |
isArchived()
Tests whether the file named by this abstract pathname is archived. |
boolean |
isHidden()
Tests whether the file named by this abstract pathname is hidden. |
boolean |
isLocked()
Tests whether the file named by this abstract pathname is locked. |
int |
length()
Returns the length of the file denoted by this abstract pathname. |
boolean |
mkdir()
Creates the directory named by this abstract pathname. |
void |
open()
Opens an existing binary file in the current I/O mode (read only by default). |
void |
open(short mode)
Opens a binary file. |
char |
readByte()
Reads an 8 bit byte. |
void |
readBytes(moka.io.char_p buffer,
short len)
Copies to a buffer of bytes up to the specified length bytes read from the stream. |
boolean |
renameTo(java.lang.String dest)
Renames the file denoted by this abstract pathname. |
boolean |
rmdir()
Removes the directory named by this abstract pathname including all files in it. |
void |
seek(int pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. |
boolean |
setArchived(boolean b)
Sets if the file named by this abstract pathname is archived (in the archive memory instead of the RAM). |
boolean |
setHidden(boolean b)
Sets if the file named by this abstract pathname is hidden (invisible for the TI-BASIC programs). |
boolean |
setLocked(boolean b)
Sets if the file named by this abstract pathname is locked (cannot be altered). |
static moka.io.File |
showVarLinkDialog()
Shows the VAR-LINK dialog and return a file object, associated to the TIOS variable selected in the dialog. |
void |
skip(int n)
Skips over n bytes of data from this file. |
void |
writeByte(char val)
Writes an 8 bit byte. |
void |
writeBytes(moka.io.char_p buffer,
short len)
Writes a buffer of bytes up to the specified length. |
Methods inherited from class moka.io.IOStream |
readBoolean, readChar, readChars, readDouble, readInt, readLong, readObject, readShort, readString, writeBoolean, writeChar, writeChars, writeDouble, writeInt, writeLong, writeObject, writeShort, writeString |
Methods inherited from class moka.lang.Object |
equals, getClassName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final short MODE_OPEN_READ
public static final short MODE_WRITE
public static final short MODE_APPEND
public static final short MODE_OPEN_UPDATE
public static final short MODE_UPDATE
public static final short MODE_UPDATE_APPEND
public static final short MODE_OPEN_READ_TEXT
public static final short MODE_WRITE_TEXT
public static final short MODE_APPEND_TEXT
public static final short MODE_OPEN_UPDATE_TEXT
public static final short MODE_UPDATE_TEXT
public static final short MODE_UPDATE_APPEND_TEXT
public short mode
public java.lang.String name
public java.lang.String type
Constructor Detail |
public File(java.lang.String pathname)
File
instance by using the given pathname string.
If the pathname string object risk to be used later, use a copy of the string object
instead of the original.
pathname
- A pathname stringMethod Detail |
public static moka.io.File showVarLinkDialog()
public static void export(java.lang.String name, long l)
public static void export(java.lang.String name, int i)
public static void export(java.lang.String name, short s)
public static void export(java.lang.String name, byte b)
public static void export(java.lang.String name, double d)
public static void export(java.lang.String name, char c)
public static void export(java.lang.String name, boolean b)
public static void export(java.lang.String name, java.lang.String s)
public static void exportExpr(java.lang.String name, java.lang.String expr)
public void open()
open
in class IOStream
public void open(short mode)
mode
- The file modepublic void close()
close
in class IOStream
public int available()
public boolean delete()
true
if and only if the file is
successfully deleted; false
otherwisepublic boolean exists()
true
if and only if the file denoted by this
abstract pathname exists; false
otherwisepublic boolean isArchived()
public boolean isHidden()
public boolean isLocked()
public int length()
public boolean mkdir()
true
if and only if the directory was
created; false
otherwisepublic boolean renameTo(java.lang.String dest)
dest
- The new abstract pathname for the named file
true
if and only if the renaming succeeded;
false
otherwisepublic boolean rmdir()
true
if and only if the directory was
removed; false
otherwisepublic void seek(int pos)
pos
- the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.public boolean setArchived(boolean b)
b
- a flag indicating whether this file component is archived.
public boolean setHidden(boolean b)
b
- a flag indicating whether this file is Hidden.
public boolean setLocked(boolean b)
b
- a flag indicating whether this file is locked.
public void skip(int n)
n
- the number of bytes to be skipped.public void writeByte(char val)
writeByte
in class IOStream
val
- the byte value to be writtenpublic void writeBytes(moka.io.char_p buffer, short len)
writeBytes
in class IOStream
buffer
- the buffer of bytes to be writtenlen
- the specified lengthpublic char readByte()
readByte
in class IOStream
public void readBytes(moka.io.char_p buffer, short len)
readBytes
in class IOStream
buffer
- the buffer of bytes where the bytes will be copiedlen
- the specified lengthpublic void finalize()
finalize
in class IOStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |