The NORD File System.
A "file" in this context means a collection of records or blocks, ordered randomly or sequentially. The File System manipulates files on disks, magnetic tapes, cassette tapes, floppy disks, or standard peripherals. Files on disks, floppy disks and magnetic tapes are treated in a uniform manner. The storage unit is always 1024 words (2K bytes), however, when adressing the file any other block size may be used.
A file is named with a character string, and this name is used in all commands to the file system. When a file is accessed, the file name must be connected to a file number and this number is used in the access routines.
Each file has one owner who has to be defined as a user in SINTRAN III. The owner is normally the user who created the file. A file is always allocated in the owner's area on the mass storage device (directory). Each user may declare up to eight other users as friends and give them privileged access possibilities to his files. Other users are regarded as public users.
The File System provides individual protection of files, with separate protection modes for the owner, owner's friends and the public users.
Each mass storage device maintained by the system (disks, floppy disks and magnetic tapes) may consist of a self-contained set of files. This set is reffered to as a file directory. There may only be one file directory per medium. Each file directory may contain files for one or several users. A file directory is completely independent of all other devices, and, if contained on a removable medium, it may be moved to other installations and used there.
Each device medium (pack, diskette or tape reel) to be used as a file directory must be created with a name and entered before it can be used by the system. When a directory is not needed anymore, it may be released and dismounted. The next time it is needed, it must be mounted and entered again, etc.
The first file directory entered (usually containing SINTRAN III and related subsystems is regarded as the main directory. The main directory may not be released.
Before a user can establish files in a directory, the user name must have been defined in that directory by the @CREATE-USER command, and space must have been reserved by the @GIVE-USER-SPACE command. Such commands, which manipulate file directories, are restricted so that only the user SYSTEM may use them.
Users may be created on several file directories, but must have been created on the residing main directory. All information about a user's friends and their access privileges is kept in the main directory, together with the user's declared password. Before logging in on a terminal or starting a batch job, the user name must have been declared in the main directory, but need not have space reserved on that directory.
Any directory entered may be declared as a default directory by the command @SET-DEFAULT-DIRECTORY. This means that the users need not specify the directory name when creating or accessing files in this directory. A user should not be given space in more than one default directory. If he has, he must still specify the directory name as a prefix to the file name. Main directory is always default.
A file may be created for the first time by the @CREATE-FILE command or by, for instance, the @OPEN-FILE or the @DUMP commands, with the file name surrounded by quotation marks. All subsystems and user program files may be created in the same way by simply enclosing the name in a pair of quotation marks.
Files created by the @CREATE-FILE command with the number of pages greater than zero are allocated on a contiguous area on the mass storage device and are defined as contiguous files. Such files may only be given more pages by means of the @EXPAND-FILE command.
Files created by the @CREATE-FILE command, with the number of pages equal to zero (or created in other ways), may have their pages scattered throughout the mass storage device and are defined as indexed files. The size of these files may be expanded by new pages, dynamically, as the user writes onto the file. The indexes are kept on a separate page belonging to the file, so that an indexed file always needs one more page than a contiguous file with the same contents. Indexed files cannot be expanded by the @EXPAND-FILE command.
In addition to the file name, an alphabetical file type is added to the file name to designate the purpose of the file. This file type may be set by the user as a 4 character extension of the file name, separated by a colon (:). The following file types are used as a default when creating / accessing files in various subsystems:
With these file types, a program may take advantage of the same name for all different files. The various subsystems will access the proper file as its input or output when the file name is given. (example in Section 3.2.7) Otherwise, the user is free to introduce any other file type when he creates a new file.
Files may also be created in one or more versions, that is, complete copies of the file, so that the last version written is version 1, the previous version is 2, etc. When a file is created in more than one version, the operating system will access the one with the highest number when opened for write (and afterwards change the version to 1) and the version 1 when opened for read.
The user may also specify a certain version of the file to be accessed by appending the version number to the file name and file type, separated by a semicolon (:). New versions of an existing file may be established by the command
@CREATE-NEW-VERSION <file name> <number of pages>
or by printing the version number withing quotes by, for instance, the command
@OPEN-FILE FILE1:DATA;"4", W
The command
@CREATE-FILE FILEX;3,10
will create 3 versions of file FILEX - each version with 10 pages.
A file may be accessed in many different ways. The access mode of a file is specified as a parameter to the @OPEN-FILE command, and may be a combination of the following characters:
Only certain combinations are legal. See Sections 3.3.5.1 and 3.4.1.
The access mode may be restricted, either due to physical reasons or because the file is protected by some access modes. Legal access is defined for three groups of users; Owner, Friends and Public users.
The legal access to a file may be changed by the @SET-FILE-ACCESS command for each user group, and may be a combination of the following characters:
Default file access when a file is created is:
for PUBLIC: read access permitted
for FRIENDS: read, write and append permitted
for OWNER: all
A user may change this default file access by the command @SET-DEFAULT-FILE-ACCESS.
To allow a group of users access to his files the owner must have defined these users by the @CREATE-FRIEND command. Each defined friend may be declared with different access restrictions by the @SET-FRIEND-ACCESS command, and may be a combination of the following characters:
Thus, a friend's access to a file is defined both by his access allowed in general (with the @SET-FRIEND-ACCESS command) and by the friend access permitted to the file in question (defined with the @SET-FILE-ACCESS command)
When accessing a file belonging to another user, the file name must be preceded by the user's name in parentheses. If the file in question does not reside on that user's default directory, both the file directory name and the user's name must precede the file name, the two first names are separated by a colon and enclosed in parentheses.
Default file access when a friend is created is: read, write and append. See also Section 3.3.2.
A complete file name may be a construction like
(<file directory name>:<owner name>)<object name>:<type>;<version>
where <file directory name>, <owner name> and <object name> may consist of 1 to 16 alphanumerical characters and the special character '-' (minus); <type> may consist of 1 to 4 characters; and <version> range is from 1 to 256.
Commands to give the user information about created files, reserved space, declared friends etc.
The <file name> or <user name> in the following commands may be abbreviated, and only the selected parts that match the name given will be included in the response. If the file name is empty or only carriage return is given, all files for the user will be selected. Also, files of a specific file type may be selected giving only the name of the type preceded by a colon.
If the directory name and user name is not included in the <file name>, the user's default file directory will be searched.
The commands are: @LIST-FILES, @LIST-OPENED-FILES, @FILE-STATISTICS, @LIST-FRIENDS, @LIST-USERS, @USER-STATISTICS, @WHERE-IS-FILE.
Two commands are implemented to copy data between peripheral units and files
@COPY <destination> <source>
reads bytes from the <source> unit and writes on the <destination> unit; the destination unit may be a new file to be created by enclosing the name in double quotation marks. The command should be used for byte oriented devices. The copy operation continues until maximum byte pointer is reached, if <source> is a mass storage file.
@COPY-FILE <destination> <source>
reads pages of 1K words from <source> file and writes on the <destination> file. This command is recommended for mass storage files.
For both commands, data is completely code independent. for @COPY-FILE the copy operation continues until all pages have been copied from a file or until time out is received from a peripheral unit.
Default file type for files is :SYMB.
Both commands may also be used to or from peripherals. @COPY-FILE will also correctly copy files with holes. If the <destination> file is a non-existent CONTIGUOUS file, it must first be created by the use of @CREATE-FILE.