Invoking External Programs

io.popen()

io.popen is helpful in that it allows you to open a command line process and read and write to it.

This shows an example of getting the output from the dir command in the C:\temp\ directory. The dialog comes up by double clicking on the blue string. It’s a good idea to do D:close() after you are finished with reading from the process otherwise it may take a while for the process to be terminated when the Lua garbage collector kicks in.