[comp.os.msdos.programmer] Networks, PRN, and a quirky executable

ctl8588@rigel.tamu.edu (LAUGHLIN, CHET) (10/23/90)

In the real-time systems lab I have been programming in there is a
token ring network connecting the 286 and 386 PCs.  I have been
redirecting my standard PRN and LPT1 to the network print server.
Now, everything works just fine...but my interest has been peeked
by a certain situation.

I have a C program that spawns another program named 'fft.exe'.
This program can print to graphical picture to a printer.  I have
found that it uses PRN by experiment.  Now, the funny thing is that
if I press F1 (to print) while FFT is running the server starts
spooling but will not print.  The server reports that it is spooling
the 'document' until FFT returns to my program (user must ask to end
the FFT) and then my program ends ALSO - returning to the DOS prompt.

I have tried executing a flush of stdprn, flushall, closeall immediately
after the spawn command with no effect.  Asking FFT to print 2 graphs
spools them both, but does not print anything.  The Server itself does
not access the hard drive except for 2 or 3 seconds max after I
request a printing.

Tommorrow I plan to dig a little deeper, but perhaps someone has a good
pointer or hint to help.  To recap - the printings come out of the
server ok, but only *after* my program ends.  I'm am trying to get
the printings to print after the FFT program ends.

Thanks for any help.
+---------------------------------------------------------------+
| Chet Laughlin                  CTL8588@RIGEL.TAMU.EDU         |
|   "I have no opinions as I          (128.194.4.4)             |
|    do not exist, my lawyers                                   |
|    told me so."                                               |
+---------------------------------------------------------------+

changw@athena.ecs.csus.edu (Weide Chang) (10/23/90)

ctl8588@rigel.tamu.edu writes:
>In the real-time systems lab I have been programming in there is a
>token ring network connecting the 286 and 386 PCs.  I have been
>redirecting my standard PRN and LPT1 to the network print server.
>Now, everything works just fine...but my interest has been peeked
>by a certain situation.
> [ trouble with starting printing as wanted..]

That's the problem of IBM's famous PC-LAN built on the token-ring.

All you need to do is just add a line in your fft.c where you want
it to start printing. That's the <stdlib.h>'s

   	system("copy dummy.txt prn");

where dummy.txt is an empty file. You can try substitute dummy.txt with
NUL, then you don't need to create an actual file dummy.txt
This DOS shell call would start a new queue thus the fft.exe's queue has
to be forced to be printed.

Good luck!

vdra_ltd@uhura.cc.rochester.edu (Valerie Drake) (10/25/90)

In article <9430@helios.TAMU.EDU> ctl8588@rigel.tamu.edu writes:
>In the real-time systems lab I have been programming in there is a
>token ring network connecting the 286 and 386 PCs.  I have been
>redirecting my standard PRN and LPT1 to the network print server.
>Now, everything works just fine...but my interest has been peeked
>by a certain situation.
>
>I have a C program that spawns another program named 'fft.exe'.
>This program can print to graphical picture to a printer.  I have
>found that it uses PRN by experiment.  Now, the funny thing is that
>if I press F1 (to print) while FFT is running the server starts
>spooling but will not print.  The server reports that it is spooling
>the 'document' until FFT returns to my program (user must ask to end
>the FFT) and then my program ends ALSO - returning to the DOS prompt.
> [Edited for brevity]

You should always indicate what Network OS you are using, as well as the 
Workstation OS.  I am going to assume it is DOS and Novell, although I may
be wrong.

If it is Novell and you are using the CAPTURE command to redirect output,
Novell requires an "END OF JOB" to be executed to recognize that the print
output has ended.  The easiest way to do this is to close the printer port.
A more difficult way :-> is to end your program.  If FFT is not closing the
port within it's spawned task, CAPTURE does not know when to end the print
job so just to be safe it holds it until you exit the calling program or
print something else.  You might try opening the print port, sending a null
character, then closing the port.

The other option is to set the TIMEOUT parameter on CAPTURE to some number
of seconds.  If this option is set CAPTURE will end the print job after
XX number of seconds of inactivity.

If the network is 3com Ctrl-prtscr will force an end of job.

Hope this helps...



+---------------------+--------------------+ "After all, they're all just
|                     |                    |  Monkey Boys!"
|                     |    +--+  +--+   o  | -- Dr. Lizardo
|                     | |\/   .\/.   \/|  o| vdra_ltd@uhura.cc.rochester.edu
|        //////       | |   )) /\ ((   | o | Val & Lee Drake (The Fish Faces)
|       /_   _\       | |/\+--+  +--+/\| | | University of Rochester and
|      ( Q   ^ )      |                  | | Azatar MicroSystems
+--,,,,----U----,,,,--+--------------------+ Rochester, NY

tcs@router.jhuapl.edu (10/31/90)

In article <10032@ur-cc.UUCP>, vdra_ltd@uhura.cc.rochester.edu (Valerie Drake) writes:
>In article <9430@helios.TAMU.EDU> ctl8588@rigel.tamu.edu writes:
>>
>>       ... [Everything Deleted to make a small comment] ...
>
>If the network is 3com Ctrl-prtscr will force an end of job.
>
>Hope this helps...
>
>
>
>+---------------------+--------------------+ "After all, they're all just
>|                     |                    |  Monkey Boys!"
>|                     |    +--+  +--+   o  | -- Dr. Lizardo
>|                     | |\/   .\/.   \/|  o| vdra_ltd@uhura.cc.rochester.edu
>|        //////       | |   )) /\ ((   | o | Val & Lee Drake (The Fish Faces)
>|       /_   _\       | |/\+--+  +--+/\| | | University of Rochester and
>|      ( Q   ^ )      |                  | | Azatar MicroSystems
>+--,,,,----U----,,,,--+--------------------+ Rochester, NY

The 3Com Network (3Share) has to have SPrtSc loaded before Ctrl-PrtSc will 
work. 3+Open has to have CPrtSc (I think that's the name, or CAPrtSc) 
loaded. I picked up an Assembly routine a while back from a 3Wizard 
Conference that will allow the spool to be released while running 3+Share.

Carl Schelin                          | "Trendy earring pal, 
tcs@router.jhuapl.edu                 |  why don't you wear a dress, too?"