Search code examples
luauser-inputblockingwait

Lua - get command line input from user?


In my lua program, i want to stop and ask user for confirmation before proceeding with an operation. I'm not sure how to stop and wait for user input, how can it be done?


Solution

  • Take a look at the io library, which by default has standard-input as the default input file:

    http://www.lua.org/pil/21.1.html