Classes, Interfaces and methods for Input/Output.
Operations on files and directories.
Stdin, stdout and stderr can be used for normal input and output.
The most common methods on these are also available directly.
INTERFACE |
I_ByteWriter @public | An interface for any class that can write a byte.
|
INTERFACE |
I_CharWriter @public | An interface for any class that can write a character.
|
INTERFACE |
I_Writer @public | An interface for any class that can write a string.
|
CLASS |
Writer @public | Abstract class that implements I_Writer while only requiring subclasses
to implement write(string) by providing the
writeByte(), writeChar() and print() implementations.
|
CLASS |
File @public | File for reading and writing.
|
CLASS |
Socket @public | Socket for reading and writing.
|
CLASS |
Url @public | Uniform Resource Locator
|
INTERFACE |
I_ByteReader @public | An interface for any class that can read a byte.
|
INTERFACE |
I_CharReader @public | An interface for any class that can read a UTF-8 character.
|
INTERFACE |
I_CharOrByteReader @public | An interface for any class that can read a byte or a UTF-8 character.
|
CLASS |
ByteReader @public | A ByteReader that reads from a byteString.
|
CLASS |
ByteReaderStack @public | A wrapper around a ByteReader that supports push().
|
CLASS |
StringReader @public | A Reader that reads characters from a string.
|
CLASS |
CharReaderStack @public | A wrapper around a CharReader that supports push().
|
|
Methods for creating an IO.Socket object.
|
ENUM |
SocketProtocol @public | Protocol to use for a socket.
|
CLASS |
StringWriter @public | A Writer that stores the text in a string.
Use ToString() to get the result.
|
CLASS |
ByteWriter @public | A Writer that stores a sequence of bytes.
Call toByteString() to get the result.
|
CLASS |
FileInfo @public | Used for the return value of IO.fileInfo().
|
|
int |
eof
@public
| End Of File
|
IO.File |
stdin
@public
| Standard input.
|
IO.File |
stdout
@public
| Standard output.
|
IO.File |
stderr
@public
| Standard error output.
|
|
|
readAllBytes(reader)
byteString @public | Read all bytes from reader and return a byteString with them.
|
|
readAllChars(reader)
string @public | Read all chars from reader and return a string with them.
|
|
Methods for creating an IO.File object.
|
|
fileReader(fileName)
IO.File @public | Opens file fileName for reading.
|
|
fileWriter(fileName, truncate)
IO.File @public | Opens file fileName for writing.
|
|
clientSocket(server, port, protocol)
IO.Socket @public | Open a client socket to port on server.
|
|
Methods for reading and writing stdin and stdout
|
|
readByte()
int @public | Reads and returns one byte from stdin.
|
|
readChar()
int @public | Reads and returns one UTF-8 character from stdin.
|
|
readFile(fileName)
string @public | Reads file fileName and returns its contents as a string.
|
|
write(text)
status @public | Writes text to stdout and returns FAIL or OK.
|
|
write(number)
status @public | Writes number to stdout and returns FAIL or OK.
|
|
write(number)
status @public | Writes number to stdout and returns FAIL or OK.
|
|
write(number)
status @public | Writes number to stdout and returns FAIL or OK.
|
|
write(flag)
status @public | Writes flag as "TRUE" or "FALSE" to stdout and returns FAIL or OK.
|
|
write(ok)
status @public | Writes ok as "FAIL" or "OK" to stdout and returns FAIL or OK.
|
|
write(arg)
status @public | Writes arg depending on its actual type to stdout.
|
|
print(text)
status @public | Writes text to stdout and appends a newline.
|
|
print(text)
status @public | Writes text to stdout and appends a newline.
|
|
print(nr)
status @public | Writes nr to stdout and appends a newline.
|
|
print(nr)
status @public | Writes nr to stdout and appends a newline.
|
|
print(nr)
status @public | Writes nr to stdout and appends a newline.
|
|
print(flag)
status @public | Writes flag to stdout as "FALSE" or "TRUE" and appends a newline.
|
|
print(ok)
status @public | Writes ok to stdout as "FAIL" or "OK" and appends a newline.
|
|
print(arg)
status @public | Writes arg to stdout depending on its actual type.
|
|
print()
status @public | Writes a newline to stdout.
|
|
format(fmt, arguments)
status @public | Formats the string and writes it to stdout with a newline.
|
|
writeByte(byte)
status @public | Writes byte byte to stdout.
|
|
writeChar(char)
status @public | Writes character char to stdout as an UTF-8 byte sequence.
|
|
flush()
status @public | Flushes buffered output on stdout.
|
|
Methods for file properties
|
|
fileInfo(name)
IO.FileInfo @public | Return statistics for name.
|
|
isDirectory(name)
bool @public | Returns TRUE if name exists and is a directory.
|
|
isReadable(name)
bool @public | Returns TRUE if the file name exists and is readable.
|
|
isWritable(name)
bool @public | Returns TRUE if the file name exists and is writable.
|
|
isExecutable(name)
bool @public | Returns TRUE if the file name exists and is executable.
|
|
Operations involving directories.
|
|
chdir(dirName)
status @public | Change the current directory to dirName.
|
|
getdir()
string @public | Return the current directory.
|
|
mkdir(dirName)
status @public | Create directory dirName.
|
|
rmdir(dirName)
status @public | Delete directory dirName. Only works when it is empty.
|
|
dirList(dirName)
list<string> @public | Returns a list with all entries of directory dirName.
|
|
Operations on files
|
|
delete(fileName)
status @public | Delete file fileName.
|
|
rename(fromName, toName)
status @public | Rename file fromName to toName.
|
|
move(fromName, toName)
status @public | Move file fromName to toName by making a copy and deleting
fromName.
Not implemented yet.
|
|
copy(fromName, toName)
status @public | Copy file from to to.
Not implemented yet.
|
|
equalFiles(name1, name2)
bool @public | Compare two files and return TRUE if both exist, can be read and contain
the same bytes.
|
|
Operations on file names and paths.
|
|
findExe(exeName)
string @public | Finds exeName in $PATH and returns the actual location.
|
|
findExeInDirList(exeName, dirs)
string @public | Searches for exeName in each directory in dirs and returns the
first one that exists and is executable.
|
|
findFirstExe(alternatives)
string @public | Find the first executable in alternatives that exists.
|
|
modifyExeName(exeName, newName)
string @public | Given an executable name returns a different executable name in the same
directory.
|
|
concatPath(first, second)
string @public | Returns first and second concatenated as path parts.
|
|
isFullPath(fname)
bool @public | Returns TRUE if fname is a full (absolute) path name, the meaning
|
|
fullPath(fname)
string @public | Returns the full path of fname.
|
|
resolve(fname)
string @public | Returns fname with all symbolic links resolved.
|
|
tailIndex(fname)
int @public | Returns index of last path component in fname.
|
|
tail(fname)
string @public | Returns the last path component in fname.
|
|
root(fname)
string @public | Returns fname with the last extension removed.
|
|
rootAll(fname)
string @public | Returns fname with all extensions removed.
|
|
directory(fname)
string @public | Returns the directory name of fname.
|
|
tailSepIndex(fname)
int @public | Returns index of last path component of fname, including separator(s)
before it that are not part of the head.
|
|
pastHeadIndex(fname)
int @public | Returns index of first char after leading "c:/", "/", etc.
Returns 0 when no head found.
|
|
isPathSep(c)
bool @public | Returns TRUE if c is a path separator.
|
|
nextPartIndex(fname, idx)
int @public | Returns the index of the next path component, after the next separator.
|
|