[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1314.0. "Concurrent file access problem ?" by PADKOA::COSTEUX (Le Plat Pays qui est le mien...) Fri May 23 1997 11:29

    A customer runs two Fortran applications programs from two different
    processes. All that on a system running OVMS AXP V6.2 and he uses
    Fortran-V6.3-711-293V
    
    The first program opens a sequential file using the options 
    Status = OLD, Share, Read Only, IOSTAT=IOS
    .. and displays the records contents on a terminal.
    The second program opens the same file using the options Status = OLD,
    Share and does not update anything in the file.
    
    When both programs run at the same time the first program displays only
    a part of the file. No error occurs.
    When the first program  runs alone all works fine. I mean that the
    whole file content is displayed.
    
    Any idea ?
    
    Thanks for help.
    
    Jean-Pierre
T.RTitleUserPersonal
Name
DateLines
1314.1QUARK::LIONELFree advice is worth every centFri May 23 1997 11:386
What does the second program do after opening the file?

If the second program writes anything to the file and then closes it, the
file will be truncated at that point.

				Steve
1314.2No write doneAUBER::COSTEUXLe Plat Pays qui est le mien...Fri May 23 1997 11:578
    Steve
    
    The second program can have closed the file while the first program is
    running but he never writes into it. 
    I've suggested the customer to add the Read-Only option while opening
    the file in the second program. I'll have more news next Monday...
    
    Jean-Pierre
1314.3QUARK::LIONELFree advice is worth every centFri May 23 1997 12:037
I think that if the second program closes the file, as long as it has opened
it for write access, RMS will truncate the file at the current position.
You can turn this off by either opening READONLY (the best way), or by
supplying a USEROPEN routine which turns off FAB$V_TEF before opening the
file.

					Steve
1314.4READONLY option solves the problem.PADKOA::COSTEUXLe Plat Pays qui est le mien...Mon May 26 1997 10:133
    Specifying READONLY in the second program OPEN statement solves the 
    problem.