Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!husc6!seismo!nbires!hao!noao!mcdsun!fnf From: fnf@mcdsun.UUCP Newsgroups: comp.sys.amiga Subject: Re: dropcloth (closing initial CLI window) Message-ID: <281@mcdsun.UUCP> Date: Thu, 2-Apr-87 13:21:03 EST Article-I.D.: mcdsun.281 Posted: Thu Apr 2 13:21:03 1987 Date-Received: Sun, 5-Apr-87 10:31:34 EST Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 60 NOTE: Rob is having problems posting from his system and has asked me to post this for him, please respond to hplabs!dana!rap. ------------------------------------------------------------ In article <1449@cadovax.UUCP>, keithd@cadovax.UUCP (Keith Doyle) writes: > > Has anyone figured out how to get the dropcloth to run without having to > have a CLI window around? If I do a 'run dropcloth' from startup-sequence, > I can't 'endcli' apparently because the background task still has the > console window 'locked'? I have the same problem from a CLI invoked > from the workbench, and I haven't been able to get dropcloth to run > from an icon. > > I'd like to put it in the startup sequence, but as I said, can't get the > main CLI window to go away. Kind of diminishes the usefullness of the > dropcloth program I'd say. > (I haven't tried dropcloth yet, but here's what worked under 1.1 for programs such as CLOCK and CALCULATOR from the Wbench distribution disk). The reason the old cli won't go away from startup-sequence is that you have spawned a process that needs to point back to that console's control structures (the Process structure and the CLI structure, as I recall). There is a way around it, but only if your program DOES NOT DO ANYTHING WITH STDIN OR STDOUT. The correct way to specify (at least under 1.1... I'm writing this from memory and don't have the Amiga here) in the startup sequence is: RUN > NIL: < NIL: YOURPROGRAM > NIL: < NIL: or RUN TO NIL: FROM NIL: YOURPROGRAM TO NIL: FROM NIL: This disconnects a lot of stuff from the originating CLI and lets the startup CLI window close down, with just your program running on the workbench. From a program that DOES require CLI input, another program can be spawned using the Execute function of AmigaDOS, such that when the originating program closes down, the window can go away, even though the program has started. Use the exact same string as shown above, but this time in the Execute function. I forget, but it may also be necessary to pass in a handle to NIL: (my notes are at home... this stuff almost made it into the Prog. Guide, but not quite). struct FileHandle *fh; fh = Open("NIL:",MODE_NEWFILE); /* (check the mode, memory again) */ success = Execute(" the-above-mentioned-string ", fh, fh); Close(fh); /* now go away */ If I recall correctly, using Execute("string",0,0) leaves you with the same problem as initially reported (cannot close down the originating CLI) because the 0,0 causes stdin and stdout to be passed to the spawned process, whether it needs it or not. Anyway, hope this helps. Rob Peck hplabs!dana!rap -- = Drug tests; just say *NO*! (Moto just announced new drug testing program) = = Fred Fish Motorola Computer Division, 3013 S 52nd St, Tempe, Az 85282 USA = = seismo!noao!mcdsun!fnf (602) 438-5976 =