# Section 8.10.2.1:
FILE_MODES

###### class FILE_MODES < $ENUMS{FILE_MODES}

#### Formal Types

types
SAME = FILE_MODES ;
FILE_MODES = token

This class implements the concept of the kind of connection between a file class object and the underlying file in the program environment, indicating the actions to which the connection is limited.

The corresponding names in the culture-dependent resources file should be the language-dependent names for the English notions corresponding to the enumeration values defined below.

#### External specifications

The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ :-

- is_eq(other : SAME) : BOOL

The following feature is required to be implemented for this class in accordance with the specification given in $HASH :-

- hash : CARD

The following features are required to be implemented for this class in accordance with the specifications given in $BINARY :-

- create(storage : BINSTR) : SAME
- build(cursor : BIN_CURSOR) : SAME
- read(cursor : BIN_CURSOR) : SAME
- binstr : BINSTR
- write(fyle : BIN_FILE)

The following featuress are required to be implemented for this class in accordance with the specifications given in $STR :-

- str(lib : LIBCHARS) : STR
- str : STR

The following features are required to be implemented for this class in accordance with the specification given in $INSTR :-

- build(str : STR_CURSOR) : SAME
- build(str : STR_CURSOR, lib : LIBCHARS) : SAME

The following features are required to be implemented for this class in accordance with the specifications given in $ANCHORED_FMT :-

- fmt(descr : ANCHORED_DESCR, lib : LIBCHARS) : STR
- fmt(descr : ANCHORED_DESCR) : STR

The following features are required to be implemented for this class in accordance with the specifications given in $ENUMS{T} :-

- create(val : CARD) : SAME
- offset : CARD
- cardinality : CARD
- enum : CARD
- card : CARD
- is_enum(str : STR) : CONVERSION_RESULTS

#### Enumeration Values

This enumeration provides the values which indicate the permitted actions in respect of the file created/opened with that particular mode :-

- Write_Text - Either an existing file is to be opened or a new file is to be created with the file cursor positioned at the beginning for writing text data only irrespective of the encoding in use. When the file is closed its length will be given by the last position written. Seeking to a particular position in the file is not permitted.
- Write_Binary - Either an existing file is to be opened or a new file is to be created with the file cursor positioned at the beginning for writing binary data only. When the file is closed its length will be given by the last position written. Seeking to a particular position in the file is not permitted.
- Read_Text - An existing file is to be opened with the file cursor positioned at the beginning for reading text data only irrespective of the encoding used. The file may not be written to. Seeking to a particular position in the file is permitted.
- Read_Binary - An existing file is to be opened with the file cursor positioned at the beginning for reading binary data only. The file may not be written to. Seeking to a particular position in the file is permitted.
- Append_Text - An existing file is to be opened with the file cursor positioned at the end for writing text data only irrespective of the encoding in use. When the file is closed its length will be given by the last position written. Seeking to a particular position in the file is not permitted.
- Append_Binary - An existing file is to be opened with the file cursor positioned at the end for writing binary data only. When the file is closed its length will be given by the last position written. Seeking to a particular position in the file is not permitted.
- Create_Upd_Text - A new file is to be created with the file cursor positioned at the end for writing text data only irrespective of the encoding in use. It is an error if the file already exists. Reading and seeking to a position in the file are permitted.
- Create_Upd_Binary - A new file is to be created with the file cursor positioned at the end for writing binary data only. It is an error if the file already exists. Reading and seeking to a position in the file are permitted.
- Update_Text - An existing file is to be opened with the file cursor positioned at the beginning for reading and writing text data only irrespective of the encoding used. Seeking to a particular position in the file is permitted.
- Update_Binary - An existing file is to be opened with the file cursor positioned at the beginning for reading and writing binary data. Seeking to a particular position in the file is permitted.
- App_Upd_Text - An existing file is to be opened with the file cursor positioned at the end for writing text data only irrespective of the encoding used. Reading and seeking to a particular position in the file are permitted.
- App_Upd_Binary - An existing file is to be opened with the file cursor positioned at the end for writing binary data. Reading and seeking to a particular position in the file are permitted.

| Language Index |  | Library Index |  | Input/Output Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Friday, 17 November 2000. |