Files
- Function OpenFile(fileName$, mode)
Returns an ID for an open file to read or write.
Returns -1 if the file could not be opened.
Possible Text Modes:
- TEXT_INPUT - Open a file for reading text. The file must already exist.
- TEXT_OUTPUT - Open a new file for writing text. If the file already exist it will be overwritten.
- TEXT_APPEND - Opens a file for appending text to the end of the file. A file will be created if it doesn’t already exist
- TEXT_INPUT_PLUS - Opens a file for reading and writing text. The file must already exist.
- TEXT_OUTPUT_PLUS - Opens a file for both reading and writing. If the file already exist it will be overwritten.
- TEXT_APPEND_PLUS - Opens a file for reading and appending text to the end of the file.
- Sub CloseFile(stream)
Closes a file.
See also
- Function ReadByte(stream)
Reads a byte from a file.
- Sub WriteByte(stream, byte)
Writes a byte to the file.
See also
- Function ReadLine$(stream)
Returns the current line in the file.
- Sub Write(stream, txt$)
Writes a string to a file.
See also
- Sub WriteLine(stream, txt$)
Writes a string to a text file with a new-line appended at the end.
See also
Write(),ReadLine$()
- Sub CopyFile(src$, dst$)
Copies the contents of src$ file to a new dst$ file.
- Function RemoveFile(fileName$)
Removes a file.
- Function FileExists(fileName$)
Returns true if a file exists.
- Function MoveFile(src$, dst$)
Moves a file on the system.
Returns true if the file was able to be moved and false if it wasn’t.
- RenameFile(src$, dst$)
Renames src$ file to dst$ file.
- Function FileLength(fileName$)
Returns the size of a file in bytes.
- Function Tell(stream)
Returns the current position within the file stream.
- Function Seek(stream, pos)
Sets the position within a file to read from or write to.
See also
- Function EOF(stream)
Returns true when end of file is reached.
- Function WriteByteBuffer(stream, ByRef buf, buf_size)
Writes a number of bytes from a buffer to the file stream.
- Function ReadByteBuffer(stream, ByRef buf, buf_size)
Reads a number of bytes from a file stream to an array.
- stream - A open file.
- buffer - An array of bytes.
- buffer_size - The number of bytes to write from buffer (This should be less than size of the buffer).
See also