FANDOM


io is a Lua library. It is a library used for reading and writing files stored on the hard disk, and is essential for making persistent variables.

Library functionsEdit

Function name Arguments Returns Description Origin
io.close file handle file None Closes a file, or in the absence of an argument the output file. This function must be used to save changes to a file that is in write mode. Originated in Lua 5.2.
io.input string file file handle inputfile When called without arguments this function returns the current input file. When called with the file argument as a string it opens the named file in text mode and uses that as the default input descriptor, while if it is called with a file descriptor it will set that as the default input descriptor. Originated in Lua 5.2.
io.output string file file handle outputfile When called without arguments this function returns the current output file. When called with the file argument as a string it opens the named file in text mode and uses that as the default output descriptor, while if it is called with a file descriptor it will set that as the default output descriptor. Originated in Lua 5.2.
io.write string string None Writes to the default output file. Originated in Lua 5.2.
io.read string string string userresponse Reads from the default input file, usually resulting in a keyboard prompt showing. Originated in Lua 5.2.
io.open string file name, string mode file handle or nil and string errormsg This function opens a file handle in the mode specified in the string mode. Originated in Lua 5.2.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.