file#
Variables#
Constructors#
Functions#
bool |
Open(char32[] filepath) |
bool |
Create(char32[] filepath) |
bool |
OpenMode(char32[] filepath, char32[] mode_string) |
void |
Close() |
void |
Free() deprecated |
void |
Own() |
bool |
|
bool |
isValid() |
bool |
Allocate() |
bool |
Flush() |
int |
ReadChars(char32[] buf, int count = |
int |
ReadInts(char32[] buf, int count = |
int |
WriteChars(char32[] buf, int count = |
int |
WriteInts(char32[] arr, int count = |
int |
ReadString(char32[] buf) |
int |
WriteString(char32[] str) |
char32 |
GetChar() |
char32 |
PutChar(char32 c) |
char32 |
UngetChar(char32 c) |
bool |
Seek(long pos, bool from_current = |
void |
Rewind() |
void |
|
void |
GetError(char32[] buf) |
bool |
Remove() |
int |
WriteBytes(char32[] arr, int count = |
int |
ReadBytes(char32[] buf, int count = |
Variable descriptions#
This represents the current position in the file.
Returns true if a read call attempted to read past the end of the file.
Returns 0 if the file has not enountered an error.
Constructor descriptions#
Function descriptions#
bool Open(char32[] filepath) π Source
If the file pointer is not allocated, this will allocate it. Also closes any file that is already open on the pointer.
bool Create(char32[] filepath) π Source
If the file pointer is not allocated, this will allocate it. Also closes any file that is already open on the pointer.
bool OpenMode(char32[] filepath, char32[] mode_string) π Source
If the file pointer is not allocated, this will allocate it. Also closes any file that is already open on the pointer.
Closes any open file connected to the file pointer (which also includes βFlush()β). Does *NOT* deallocate the pointer, it is still reserved to open new files on.
Closes the currently open file as if calling Close(), then deallocates the file pointer so it may be re-used.
Warning
Deprecated! Free() no longer does anything as of ZC 3.0. Objects are now freed automatically.
Grants βOwnershipβ of the file pointer to the script that calls this function. When the script with βOwnershipβ terminates (at the same time itsβ local arrays are deallocated), this file pointer will automatically be βFree()βd.
bool isAllocated() π Source
Returns true if this pointer is allocated. This does not necessarily mean a file is open, just that the pointer has a reserved ID.
Returns true if a file is open on the pointer.
Attempts to allocate the file pointer. If it was already allocated, this will re-allocate it without freeing it!
Flushes the buffer of the file being written to.
int ReadChars(char32[] buf, int count = -1
, int pos = 0
) π Source
Reads a section of characters from the file.
int ReadInts(char32[] buf, int count = -1
, int pos = 0
) π Source
Reads a section of binary data from the file.
int WriteChars(char32[] buf, int count = -1
, int pos = 0
) π Source
Writes characters from βbufβ to file.
int WriteInts(char32[] arr, int count = -1
, int pos = 0
) π Source
Writes 32b binary data from βarrβ to file.
int ReadString(char32[] buf) π Source
Reads a section of characters from the file.
int WriteString(char32[] str) π Source
Writes the string stored in βstrβ to the file.
Reads and returns the next character in the file.
char32 PutChar(char32 c) π Source
Writes βcβ to file.
char32 UngetChar(char32 c) π Source
Un-reads βcβ to the input stream.
bool Seek(long pos, bool from_current = false
) π Source
Moves the current position of the file.
Rewinds to the beginning of the file.
Clears the active EOF and Error indicators.
void GetError(char32[] buf) π Source
Stores a string describing the current error into the buffer provided.
Deletes the file. This will close it, as with Close(), and then delete it from the filesystem.
int WriteBytes(char32[] arr, int count = -1
, int pos = 0
) π Source
Writes 8b binary data from βarrβ to file.
int ReadBytes(char32[] buf, int count = -1
, int pos = 0
) π Source
Reads a section of binary data from the file.