Classes | Files

UnixFILE : IOStream : Stream : AbstractFunction : Object

An abstract class
Source: UnixFILE.sc
Subclasses: File, Pipe

Class Methods

Inherited class methods

Undocumented class methods

UnixFILE.closeAll

UnixFILE.openFiles

Instance Methods

.isOpen

Returns whether the file is open. An open request can fail if a file cannot be found for example. This method lets you test that the open call succeeded.

.pos =

From superclass: IOStream

Answer the current file position

Arguments:

(offset)

an offset in bytes.

(origin)

one of the following Integers:

0
seek from beginning of file.
1
seek from current position in file.
2
seek from end of file.

.write(item)

Writes an item to the file.

Arguments:

item

one of the following:

Float
Integer
Char
Color
Symbol
writes the name of the Symbol as a C string.
RawArray
write the bytes from any RawArray in big endian.

.getLine(maxSize: 1024)

reads and returns a String up to lesser of next newline or 1023 chars.

.getChar

read one byte and return as a Char.

.getInt8

read one byte and return as a Integer.

.getInt16

read two bytes and return as an Integer.

.getInt32

read four bytes and return as an Integer.

.getFloat

read four bytes and return as a Float.

.getDouble

read eight bytes and return as a Float.

.getPascalString

Reads the next byte as an unsigned integer N, then reads the following N bytes and returns them as a String.

.putChar(aChar)

write a Char as one byte.

.putInt8(anInteger)

write an Integer as one byte. That is a signed Integer value between -128 and 127.

.putInt16(anInteger)

write an Integer as two bytes.

.putInt32(anInteger)

write an Integer as four bytes.

.putFloat(aFloat)

write a Float as four bytes.

.putDouble(aFloat)

write a Float as eight bytes.

.putString(aString)

write a null terminated String.

.putPascalString(aString)

Writes aString preceded by its length represented as a single byte. Throws an error if aString is longer than 255 characters.

.putString0(aString)

Writes aString followed by a zero byte, like a null-terminated C string.

Inherited instance methods

Undocumented instance methods

.contents

.flush

.getDoubleLE

.getFloatLE

.getInt16LE

.getInt32LE

.next

.nextN(n)

.put(item)

.putAll(aCollection)

.putDoubleLE(aFloat)

.putFloatLE(aFloat)

.putInt16LE(anInteger)

.putInt32LE(anInteger)

.read(buffer)

.readLE(buffer)

.writeLE(item)