home *** CD-ROM | disk | FTP | other *** search
-
- /* Runbackground */
- /* Original Author: Rob Peck. 5/9/86 */
- /* VERY slightly modified by K.Mardam-Bey 6/20/88 */
-
- This program is a modification of *ROB PECK*'s original RUNBACKGROUND
- program. I added a few lines of code to his C source, and compiled
- it - all in less than five minutes.
-
- The program RUNBACK is a VERY useful tool, however, it has one
- MAJOR fault that drives me CRAZY - if the program you want to
- RUNBACK isn't in the current directory, then you HAVE to specify
- a path.
-
- I have CHANGED this. It was very simple; just a few lines of
- code. If you specify a path, then this version of RUNBACK will try
- to get at the file in the directory you specified. If it doesn't
- find the program in the directory you specified, it exits.
-
- *BUT*, if you do NOT specify a path, then it looks for the program
- first in the current directory, and then the C: directory, then it
- looks in DF0:C and then DF1:C. If by then it doesn't find the program
- it just exits.
-
- tadaaaaaaaaa! :-)
-
- Oh yeah, it also has the added nicety of avoiding the system
- requestor if you try to access a non-existent device :-)
-
- NOTE - the "RUN" command MUST be in the C: directory for this
- program to work.
-
- I had both the C source and the assembly source for this program but
- since I don't know how to program in assembly, I used Rob Pecks C
- source. if anyone out there would like to change the assembly version
- to what I've done here (which should be VERY easy), please do so. As you
- can see, the size of this RUNBACK is many times larger than it's assembly
- language counterpart. (which shouldn't really be a problem for hard-disk
- owners, but may be on the "large side" for us floppy-drive amigans :-).
-
- well, as always,
- have fun..
- Khaled Mardam-Bey.
-
- ID on PeopleLink and Portal : LAD
-
- ***************************************************************************
-
- The following description comes from the original runbackground.c:
-
- ***************************************************************************
- --------------
- runbackground.c
- ---------------
-
- SUMMARY: A Workbench Disk can be used to autostart an application
- through the use of the startup script and close the startup CLI.
-
-
- Users have commented that it is not possible to start a process going
- from the startup script and then cause the initial CLI to go away.
- Here is the solution to that problem, named appropriately:
-
- RUNBACKGROUND
-
- which starts and runs a background task. This does indeed allow you to
- create a startup script that will set up your workbench running any
- programs you might wish, removing the initial CLI in the process.
-
- Your s/startup-sequence can contain lines such as the following:
-
- RUNBACKGROUND -3 clock
- RUNBACKGROUND utilities/calculator
- RUNBACKGROUND -5 utilities/notepad
-
- where RUNBACKGROUND is the command and the second parameter is the filename
- which may be preceded by a flag-variable that specifies an optional delay
- time. The delay can be from 0 to 9, for the number of seconds that
- the startup script should sleep while allowing the background task to
- load and start. I've put that in to minimize thrashing of the disk as it
- tries to load several projects at once.
-
-
- LIMITATIONS:
-
- The program that you run cannot require any input from an interactive
- CLI that starts it. Additionally, you cannot specify any file
- redirection in the command line since this program provides the
- redirection for you already. If you need to use redirection for
- your command, you can modify the source code where shown, thus
- allowing the redirection to become one of the parameters passed
- through to your program.
-
- RUNBACKGROUND does pass your command line parameters to the program
- you wish to start, but limits the total length of your command
- string to 227 (255 minus the 28 characters for "RUN >NIL: <NIL: "
- preceding your own file pathname and ">NIL: < NIL: " following it.)
-
-
- **********************************************************************
-