Sleep test ..\fsleep

                The code in this section was designed to test a way for a Fortran code to wait until another code has created a file before continuing.  It waits 1 second, then 2, then 4 and so on. 

                The idea is to wait until the file is ready to be opened. Thus there needs to be a loop waiting for a signal. -  Note that this uses a Watcom specific extension to Fortran 77 – Inquire.  Then the code sleep is actually a C code.  The code fsleep is made in mic2c.c.  The C code has nothing in it about the Fortran except note that the *n is passed by reference.  The mixing of Fortran and C is directed by the nominal comment line c$pragma aux fsleep "!_" in   mix2f.for.  The code mix2f as originally envisioned is shown below.  mix2.wpj

            Logical ex

            N=1

                Do i = 1 to 8

                     Inquire(file='filea.out',exist=ex)

                 If(.not.ex)then

                    Sleep(n)

                    N=2*n

                else

                endif

                   Open(11,file='sigb.out',status='old',err=12)

                   Exit

            enddo