/
io.popen()
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.
, multiple selections available,
Related content
Invoking External Programs
Invoking External Programs
More like this
What is io.popen?
What is io.popen?
More like this
I thought popen does not give us the exit code of the process it ran
I thought popen does not give us the exit code of the process it ran
More like this
Opening Files
Opening Files
More like this
popen doesn't make it simple to change the working directory for a process
popen doesn't make it simple to change the working directory for a process
More like this
Reading Files
Reading Files
More like this