File : read ([length]) methodReads data from the file.
lengthAn optional number indicating the number of characters (or bytes in binary encoding) to read.
When no value is provided, the method read all data from the current position until the end of file is reached.
Return valueReturns the data as a string (for utf8 and unicode encoding) or as a Buffer (for binary encoding).
local console = require "console" console.write("Do you want to quit ? (y/n) ") -- read one character from console.stdin standard File local c = console.stdin:read(1) if c == "y" then print("Bye !") else print("Let's continue...") end