2 #include <proto/exec.h>
4 #include <aros/debug.h>
9 * A tool like "R" http://www.geit.de/eng_r.html requires that we can
10 * call a command such that it prints the template and then stops.
15 // in the real "R" we would check for an unused file name first
16 BPTR input
= Open("t:00000001.request.infile", MODE_NEWFILE
);
17 BPTR output
= Open("t:00000001.request.outfile", MODE_NEWFILE
);
19 // shut up DOS error message
20 struct Process
*me
= (struct Process
*)FindTask(NULL
);
21 APTR oldwin
= me
->pr_WindowPtr
;
22 me
->pr_WindowPtr
= (APTR
)-1;
24 // execute the command. The purpose of "*>NIL:" is to
26 Execute("dir *>NIL: ?", input
, output
);
29 me
->pr_WindowPtr
= oldwin
;
31 Seek(output
, 0, OFFSET_BEGINNING
);
34 if (FGets(output
, buffer
, sizeof buffer
))
36 bug("*****\n%s*****\n", buffer
);