[net.micro.amiga] Simple Print Spooler

danny@convex.UUCP (03/22/86)

** Eat Me **

For those of you who don't like typing source code or didn't get Amiga Mail
Vol. 1, here is the source of a Shell Script Print Spooler written by Andy
Finkel.  It copies all the DOS commands it uses into ram: and eats about
60K.  When you call it to print a file, it puts it into either file1,
file2, or file3 in ram:spool.  If all these exist then it says to try
again.  The spooler itself runs constantly and if either of the three files
mentioned exists, it prints them.  It works fine.  One problem I've found
that it has with my Epson FX-85 is this: Every time it reopens the printer,
a blank line is printed.  I've fixed that problem and saved ~10K by
changing every occurance of prt: to par: in 'spooler' and it works just great!
There are three files here.  Put each of them in S:. To start the spooler
type:  execute startspool.  To print a file type:  execute print <filename>.
These commands can be typed while in any directory.

Here we go!

File#1: s/startspool
; Simple Print Spooler
; Program by Andy Finkel
; Copyright (c) 1986,
; Andy Finkel, Commodore/Amiga
; This is contributed free software.
; Permission to copy and use as long as this notice is included.
; Permission NOT given to sell this program.
; (I'd feel guilty if someone paid for this, it was too easy to do!)
;
if not exists ram:spool
makedir ram:spool
endif
if not exists ram:c
makedir ram:c
endif
if not exists ram:t
makedir ram:t
endif
copy c:copy to ram:c
copy c:delete to ram:c
copy c:echo to ram:c
copy c:execute to ram:c
copy c:wait to ram:c
copy c:quit to ram:c
copy c:run to ram:c
copy c:if to ram:c
copy c:endif to ram:c
copy s:spooler to ram:c
cd ram:c
run > nil: quit +
execute ram:c/spooler
; end of file

File #2:s/spooler
; Copyright(c) 1986,
; Andy Finkel, Commodore/Amiga
if exists ram:spool/file1
copy > nil: ram:spool/file1 to prt:
echo > prt: " "
delete ram:spool/file1
endif
;
if exists ram:spool/file2
copy > nil: ram:spool/file2 to prt:
echo > prt: " "
delete ram:spool/file2
endif
;
if exists ram:spool/file3
copy > nil: ram:spool/file3 to prt:
echo > prt: " "
delete ram:spool/file3
endif
;
wait 30
run > nil: quit +
execute ram:c/spooler
; end of file

File#3:s/print
.k file/a
; Copyright(c) 1986,
; Andy Finkel, Commodore/Amiga
If not exists ram:spool/file1
copy <file> to ram:spool/file1
skip
endif
if not exists ram:spool/file2
copy <file> to ram:spool/file2
skip
endif
if not exists ram:spool/file3
copy <file> to ram:spool/file3
skip
endif
echo "Spooler busy, try again later"
lab
; end of file