io.popen()

io.popen() is used to run a program in a separate process by specifying a command and mode. It returns a new file handle that can be used to read or write data to a program. See Opening Files for the modes you can specify.

Try out this code sample in the Developing in the Translator:

-- read current directory local P = io.popen("pwd", "r") local Directory = P:read("*a") P:close()

io.popen() can be useful for many command line interactions. See Invoking External Programs.

Â