Lahey Support
08-15-2003, 12:19 AM
At 02:09 PM 1/30/99 -0500, Michael Milgram wrote:
>Hello all.
>
>Does anyone know how to share files on Windows 95/98 using Fortran?
>
>I have a DOS based program that runs for days on end in a background DOS
>window, writing a checkpoint tape every few hours. If I inspect this
>file from a second DOS window, it always shows length 0 although the
>true length is more like 40MB; if I try to
>copy it to another file I get a sharing violation message. The fact
>that I get a message suggests that there is a way around it, perhaps by
>using some parameter on the open statement in the program, but I can't
>find anything in LF90 or LF95 manual that looks like it might do this.
>
>The problem occurs when WIN98 crashes, which it does infrequently, and I
>have to reboot. I can retrieve the checkpoint file using SCANDISK, but
>it is always the wrong length and therefore unuseable. If I could
>access the file from another window while the big program was running, I
>could write a program that copies the latest version of the checkpoint
>file to a second file every few hours, so it could be retrieved when the
>system crashes. Closing and re-opening the file, or flushing buffers
from inside the main program is not an option - the program logic is far
>too complex and writes too many intermediate files from the same place
>to allow this. Any ideas would be appreciated.
>
>For other reasons, I have to compile using F77L3, so any ideas that
>would allow me to continue compiling with that compiler would be even
>more appreciated.
>
>Thanks
>Mike Milgram
>
>
If you close the file after writing it, then any other process should
be able to access it. YOu stated the file is written once every few hours,
not continuously, so this should work. If you fear loosing it all by dying
while
the file is being written, then just use two different files, writing them
alternately.
ralph frisbie
>Hello all.
>
>Does anyone know how to share files on Windows 95/98 using Fortran?
>
>I have a DOS based program that runs for days on end in a background DOS
>window, writing a checkpoint tape every few hours. If I inspect this
>file from a second DOS window, it always shows length 0 although the
>true length is more like 40MB; if I try to
>copy it to another file I get a sharing violation message. The fact
>that I get a message suggests that there is a way around it, perhaps by
>using some parameter on the open statement in the program, but I can't
>find anything in LF90 or LF95 manual that looks like it might do this.
>
>The problem occurs when WIN98 crashes, which it does infrequently, and I
>have to reboot. I can retrieve the checkpoint file using SCANDISK, but
>it is always the wrong length and therefore unuseable. If I could
>access the file from another window while the big program was running, I
>could write a program that copies the latest version of the checkpoint
>file to a second file every few hours, so it could be retrieved when the
>system crashes. Closing and re-opening the file, or flushing buffers
from inside the main program is not an option - the program logic is far
>too complex and writes too many intermediate files from the same place
>to allow this. Any ideas would be appreciated.
>
>For other reasons, I have to compile using F77L3, so any ideas that
>would allow me to continue compiling with that compiler would be even
>more appreciated.
>
>Thanks
>Mike Milgram
>
>
If you close the file after writing it, then any other process should
be able to access it. YOu stated the file is written once every few hours,
not continuously, so this should work. If you fear loosing it all by dying
while
the file is being written, then just use two different files, writing them
alternately.
ralph frisbie