Io.input

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2011.6
Class: io

Description

When called with a file name, it opens the named file (in text mode), and sets its handle as the default input file.

When called with a file handle, it simply sets this file handle as the default input file.

When called without parameters, it returns the current default input file. <syntaxhighlight lang="lua"> (file) = io.input(file) </source>

In case of errors this function raises the error, instead of returning an error code.

Parameters

file: (file) file object to use as default input optional

Return values

Returns (file) default input file object