Io.read

From GiderosMobile
Revision as of 12:33, 20 August 2026 by MoKaLux (talk | contribs)

Available since: Gideros 2011.6
Class: io

Description

Reading from default input, basically equivalent to io.input():read.

(string) = io.read(format1,...)

Parameters

format1: (string) reading format, possible values:

  • "*all" reads the whole file
  • "*line" reads the next line, default
  • "*number" reads a number
  • num reads a string with up to num characters

...: (string) more optional formats optional

Return values

Returns (string) returns read values or nil

Example

local fd = io.open(path.."/"..file, "rb")
local header = fd:read(27) -- reads a string with up to 27 characters