file:lines()

file:lines (···) Returns an iterator function that, each time it is called, reads the file according to the given formats. When no format is given, uses "l" as a default. As an example, the construction for c in file:lines(1) do body end will iterate over all characters of the file, starting at the current position. Unlike io.lines, this function does not close the file when the loop ends. In case of errors this function raises the error, instead of returning an error code.

file:flush()

file:flush () Saves any written data to file.

file:close()

file:close () Closes file. Note that files are automatically closed when their handles are garbage collected, but that takes an unpredictable amount of time to happen. When closing a file handle created with io.popen, file:close returns the same values returned by os.execute.

error()

error (message [, level])messageerror Usually, error adds some information about the error position at the beginning of the message, if the message is a string. The level argument specifies how to get the error position. With level 1 (the default), the error position is where the error function was called. Level 2 points the error to where the function that called error was called; and so on. Passing a level 0 avoids the addition of error position information to the message.

dofile()

dofile ([filename])dofilestdindofiledofile

debug.upvaluejoin()

debug.upvaluejoin (f1, n1, f2, n2) Make the n1-th upvalue of the Lua closure f1 refer to the n2-th upvalue of the Lua closure f2.

debug.upvalueid()

debug.upvalueid (f, n) Returns a unique identifier (as a light userdata) for the upvalue numbered n from the given function. These unique identifiers allow a program to check whether different closures share upvalues. Lua closures that share an upvalue (that is, that access a same external local variable) will return identical ids for those upvalue indices.

debug.traceback()

debug.traceback ([thread,] [message [, level]]) If message is present but is neither a string nor nil, this function returns message without further processing. Otherwise, it returns a string with a traceback of the call stack. The optional message string is appended at the beginning of the traceback. An optional level number tells at which level to start the traceback (default is 1, the function calling traceback).

debug.setuservalue()

debug.setuservalue (udata, value) Sets the given value as the Lua value associated to the given udata. udata must be a full userdata. Returns udata.

debug.setupvalue()

debug.setupvalue (f, up, value) This function assigns the value value to the upvalue with index up of the function f. The function returns nil if there is no upvalue with the given index. Otherwise, it returns the name of the upvalue.