25 October 2014, 01:24 | #1 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
How can I do I/O redirection to a simple console window?
I'm opening a simple console on 3.1 with
Open("CON:0/0/640/100/Console", MODE_NEWFILE)and then I do Execute("program", con, con), expecting the program to use the new console for its input and output. Even a simple program crashes after it has output something to the window. Setting the output handle to NULL stops it from crashing, but the console turns into an interactive shell after the program has finished, and I don't want that. Is there any simple way to get this to work, and if not, what is the correct way? Thanks |
25 October 2014, 09:41 | #2 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 720
|
This might be of help http://amigadev.elowar.com/read/ADCD.../node016C.html
|
25 October 2014, 10:56 | #3 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,024
|
Quote:
Now you have tried Execute (program,con,con) and Execute (program,con,0) Don't you think there is at least one more combination to try? And don't you think that reading the autodocs is also an option to answer such a question? http://amigadev.elowar.com/read/ADCD.../node015E.html |
|
25 October 2014, 21:12 | #4 | ||
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Quote:
I'm still interested in hearing if there's a quick solution that runs on 1.3 without having to go through OpenWindow(), console.device, or creating a new process on the fly. Thanks |
||
25 October 2014, 22:44 | #5 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,024
|
The docs clearly say that it is not allowed to set both handles to the same file.
You can append "\nEndCLI\n" to the end of your command line, then Execute will return when the command is executed. You might want to prepend "FailAt 21" to the command line so that it does not exit to the shell if something goes wrong. "FailAt 21\nList SYS: ?\nEndCLI\n" |
26 October 2014, 23:42 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Thanks a lot, that's the simple solution I was looking for
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simple Mail Help | adgloride | support.Apps | 5 | 27 July 2020 21:35 |
Filesystem read redirection | Vot | Coders. General | 2 | 07 October 2012 11:43 |
Execute Command Redirection Help | Ed Cruse | Coders. General | 2 | 30 September 2008 16:59 |
A little simple tool | zeGouky | project.Sprites | 7 | 05 November 2005 21:52 |
Printer redirection | Jherek Carnelia | support.WinUAE | 1 | 14 January 2002 17:57 |
|
|