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