May 2018
Beginner
252 pages
6h 19m
English
Running an external process, program, or shell script from within a Red app is easy—just use the call word. Here are some examples you can try out in the Red console:
;-- see Chapter10/interacting-os.red:call "explorer.exe" ;== 9668 (1)call/shell "notepad.exe" ;== 2292 (2)call/shell "notepad.exe info.txt" ;== 11632 (3)cmd: "notepad.exe info.txt"call/shell cmd ;== 7244 (4)call/shell/wait "notepad.exe" ;== 0 (5)call/output "ls" %listing ;== 0 (6)call "start copy nul > myfile.txt" ;== 13760 (7)
Let's break down what's happening line by line: