OPEN-FILE: Difference between revisions

From NDWiki
Jump to navigation Jump to search
(added Related commands section)
(fixed layout of parameters, expanded text)
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
This command is used to make a file available for access, and returns the logical unit number to be used for accessing the file.
This command is used to make a file available for access, and returns the logical unit number to be used for accessing the file.


<file name>
; <file name> : could be the name of a peripheral unit, eg., LINE-PRINTER or a user file name, which may be prefixed with [[file-directory-name]] and [[user-name]] if necessary.


could be the name of a peripheral unit, eg., LINE-PRINTER or a user file name, which may be prefixed with [[file-directory-name]] and [[user-name]] if necessary.
; <type> : if a file with a specific [[file types|type]] is to be opened. The default value is :SYMB.


<pre>:<type></pre>
; <version> : if a specific version is to be opened. The default value is 1.
if a file with a specific [[file types|type]] is to be opened. The default value is :SYMB.


<pre>;<version></pre>
; <access type> : specifies the intended [[access modes|access-mode]], only the following combinations are legal:
 
if a specific version is to be opened. The default value is 1.
 
<access type>
 
specifies the intended [[access modes|access-mode]], only the following combinations are legal:
  R  - sequential read
  R  - sequential read
  W  - sequential write
  W  - sequential write
Line 34: Line 27:


A list of logical numbers is given in <ref>{{ND-doc|60.050.06}}Appendix C</ref>.
A list of logical numbers is given in <ref>{{ND-doc|60.050.06}}Appendix C</ref>.
Rules:
#Permitted for all users with legal <access type> to the file.
#New file names and / or versions may be created when opening the file by enclosing <file name> in quotes.
#If file access is permitted, the message "FILE NUMBER IS = n" is printed <n> (octal) is the logical device number to be used for later access.
#An error message is produced if the file can not be opened.
#Files opened for sequential read and write occupy two device buffers. If all files are accessed sequentially, the maximum number of simultaneously opened files is 12. If all files are accessed randomly the number is 18.
#{{ND-doc|60.128.01}} (printed June 1980), Appendix I shows a list of logical device numbers. {{ND-doc|60.128.01}} (printed February 1983) Appendix C lists logical device numbers. This is the default number specified by ND at system generation.
Example:
@OPEN-FILE "F-1:DATA", W
FILE NUMBER IS 000101
@
The indexed file F-1:DATA is created and opened for sequential write only. It is assigned the file number 101 (octal).
== Related commands ==
== Related commands ==
@[[CONNECT-FILE]]
@[[CONNECT-FILE]]


@[[CLOSE-FILE]]
@[[CLOSE-FILE]]
@[[RTCONNECT-FILE]]
@[[RTOPEN-FILE]]


@[[SCRATCH-OPEN]]
@[[SCRATCH-OPEN]]


@[[SET-PERMANENTLY-OPENED]]
@[[SET-PERMANENTLY-OPENED]]
[[OPEN (monitor call)]]


== References ==
== References ==
{{ND-doc|60.050.06}} section 3.4.5.1
{{ND-doc|60.050.06}} section 3.4.5.1
{{ND-doc|60.128.01}} (printed June 1980), pages 1-113, 1-114
{{ND-doc|60.128.03}} (printed February 1983), page 1-143


{{ND-doc|60.174.Q01}}
{{ND-doc|60.174.Q01}}
<references/>
<references/>
[[Category:Background Commands]]
[[Category:Background Commands]]

Latest revision as of 15:20, 2 October 2017

@OPEN-FILE <file name> [:<type>[;<version>]], <access type>

This command is used to make a file available for access, and returns the logical unit number to be used for accessing the file.

<file name>
could be the name of a peripheral unit, eg., LINE-PRINTER or a user file name, which may be prefixed with file-directory-name and user-name if necessary.
<type>
if a file with a specific type is to be opened. The default value is :SYMB.
<version>
if a specific version is to be opened. The default value is 1.
<access type>
specifies the intended access-mode, only the following combinations are legal:
R  - sequential read
W  - sequential write
RW - sequential read and write
RX - random read
WX - random read and write
WA - sequential write append
RC - random read with read and write access from other users allowed (only contiguous files)
WC - random read and write with read and write access from other users allowed (only contiguous files)

If the user is allowed access to the file, the following messages is printed

FILE-NUMBER IS = n

where n is the logical unit number to be used when accessing the file later.

New file names and / or number of versions may be created together with the opening of the file by enclosing the name or number in quotation marks.

If, for any reason, it is not possible to open the file, an explanatory message is given.

A list of logical numbers is given in [1].

Rules:

  1. Permitted for all users with legal <access type> to the file.
  2. New file names and / or versions may be created when opening the file by enclosing <file name> in quotes.
  3. If file access is permitted, the message "FILE NUMBER IS = n" is printed <n> (octal) is the logical device number to be used for later access.
  4. An error message is produced if the file can not be opened.
  5. Files opened for sequential read and write occupy two device buffers. If all files are accessed sequentially, the maximum number of simultaneously opened files is 12. If all files are accessed randomly the number is 18.
  6. Norsk Data Document ND–60.128.01 SINTRAN III REFERENCE MANUAL (printed June 1980), Appendix I shows a list of logical device numbers. Norsk Data Document ND–60.128.01 SINTRAN III REFERENCE MANUAL (printed February 1983) Appendix C lists logical device numbers. This is the default number specified by ND at system generation.

Example:

@OPEN-FILE "F-1:DATA", W

FILE NUMBER IS 000101

@

The indexed file F-1:DATA is created and opened for sequential write only. It is assigned the file number 101 (octal).

Related commands

@CONNECT-FILE

@CLOSE-FILE

@RTCONNECT-FILE

@RTOPEN-FILE

@SCRATCH-OPEN

@SET-PERMANENTLY-OPENED

OPEN (monitor call)

References

Norsk Data Document ND–60.050.06 SINTRAN III USERS GUIDE section 3.4.5.1

Norsk Data Document ND–60.128.01 SINTRAN III REFERENCE MANUAL (printed June 1980), pages 1-113, 1-114

Norsk Data Document ND–60.128.03 SINTRAN III REFERENCE MANUAL (printed February 1983), page 1-143

Norsk Data Document ND–60.174.Q01 SINTRAN III QUICK REFERENCE CARD

  1. Norsk Data Document ND–60.050.06 SINTRAN III USERS GUIDE Appendix C