file
Provides file operations
class file
This class does not inherit to any class.
construct()
— The constructor. Create an instance of class file
and open a file close()
— Close the file associated with the handle and disassociate it eof()
— Check whether file pointer is at the end-of-file (EOF) or not read()
— Read a single sequence from the opened file readbyte()
— Read a single byte from the opened file (binary mode) readln()
— Read a single line from the opened file readstring()
— Read multiple bytes from the opened file and convert them to string (binary mode) reopen()
— Close the current handle and reopen a file size()
— Get size of the file associated with the handle write()
— Write value
to the opened file writebyte()
— Write a single byte to the opened file (binary mode) writeln()
— Write value
& new line (\n
) to the opened file writestring()
— Write multiple bytes to the opened file (binary mode)
import fileio
f = file("data.txt", file_write)
f.writeln("Hello!")
f.close()