J3/04-254 To: J3 From: Craig Dedo Date: February 16, 2004 Subject: File Sharing Modes Number: Title: File Sharing Modes Submitted By: Craig Dedo Status: For Consideration References: Basic Functionality: The new standard should allow for the specification of file sharing modes. The file sharing specifier should allow the programmer to specify any of the four sharing modes: * Exclusive use by this unit * Reading by others, but not writing * Writing by others but not reading * Permit full access by others Rationale: Currently, there is no facility for file sharing in the Fortran standard. Some processors already provide this capability but there are widely varying implementations. Some implementations do not allow specification of all four sharing modes. The ability to specify file sharing modes would allow Fortran developers to support frequently accessed multi-user data bases on time-sharing systems or local area networks. With the growing complexity of software and the growing numbers of networked desktop PCs, there will be a large demand for simultaneous access to complex data bases. Estimated Impact: There should be no impact on exiting codes. Processors which already provide this capability in a non-standard manner will have to develop the support for the standard syntax. Detailed Specification: The best method would be to allow for a second specification in the character expression that follows the ACTION= keyword, in the same manner that Lahey Fortran does. In the character expression, the access mode specifier and sharing mode specifier would be separated by a comma. Either one could come first. Alternatively, there could be a separate keyword, such as SHARE or something similar. The sharing mode specifier could have one of these four values, with the indicated actions: Sharing Mode Keywords Action NONE For exclusive use by this unit in this process READONLY Allows reading by others, but not writing WRITEONLY Allows writing by others, but not reading READWRITE Allows others to open the file for both reading or writing History: