[comp.protocols.pcnet] Trouble with MSC, FileIO, & 10Net

youmans@cs.odu.edu (R. Scott Youmans) (03/13/90)

I am using 2 386 IBM-PC clones with DOS 3.3, 10NET Lan software,
Metawindows & Island Graphics software and Microsoft C5.1 ... and I
have a problem.  The overview of the task is simple: pressing a key on
PC-A pulls up a graphics screen on both PC-A and PC-B. PC-B should not
display its screen until it receives a signal from A. This is done for
20 screens.

To do this quickly, I decided to use a shared file ovcer the network.
PC-A creates it whenever a key is pressed. PC-B loops on fopen()!=NULL
until the file exists. Then it closes the file, deletes it, and
displays its image. So, what`s the problem?

PC-A runs fine all the way through. PC-B only runs through about half (13)
of the screens! Here is the main loop on PC-B:

	while (!kbhit() && current < 19) {
	   if (next = fopen (SYNC, "r") != NULL) {
		fclose(next);
  		readstatus = ReadPaint (image_list[current++], thePort);
		remove (SYNC);
	   }
	}

So, while it is not interrupted with a keypress, or current is < 19, it checks
for the existance of the SYNC file. If present, it closes it, read in the image
and removes the file. 

I have tracked down the problen to the fopen in ReadPaint. It is unable to 
open the file even though it is in the current directory. Then, on subsequent
attempts the fopen(SYNC) command fails, even though the file is present. It is
as if I ran out of files to open, or some buffer got screwed.

Oh, in config.sys, files=40 buffers=20.

If one of you recognises the problem, or wishes to help, I would like 
your assistance. I've put too many hours on this already.

Also, if you know of an alternative (Interprocess Communication or other)
on 10Net or with shared files, please speak up!

This is my first big experience with MSC and DOS (from a UNIX environment),
so don't hesitate to state the obvious.

Much thanks, (the weary...)
Scott Youmans....................................youmans@cs.odu.edu
Computer Science
Old Dominion University..............................Save The Earth