Topic: APLX Help : Help on APL language : Component File Systems : ⍇ based File System
[ Next | Contents | Index | APL Home ]

based File System

The APLX based File System uses four primitive functions to transfer APL data between the active workspace and a file space located on a disk storage device:

             ⍇         File Read         ('Quad-Read')
             ⍈         File Write        ('Quad-Write')
             ⍐         File Hold         ('Quad-Hold')
             ⍗         File Drop         ('Quad-Drop')

APL files are identified by a file number, and components are accessed by component number. A file may be kept secure from other users by passwords, or by one of two methods of access control: control of access by user number, and a file or component hold facility.

The file system has been designed to facilitate casual use of the system without reducing the security features which may be required by more complex applications. Files are created automatically when the first write operation is performed.

Individual components may be any valid APL data, including overlays. The components keep their type and shape when stored and retrieved. Components may be added or inserted at any point in a file and any component may be deleted, even if it is located in the middle of a file.

APL files are located in a 'data space'. There may be several 'data spaces' throughout the system. Each 'data space' is independent of all other 'data spaces'. A utility program is supplied with APLX to create and maintain these 'data spaces', and this will be detailed in the system dependent notes. All file operations allow subscripts to select, via a logical unit number set in the ⎕MOUNT function, which 'data space' is to be used in a given operation.

Basic File Operations

A file consists of a set of sequentially numbered components, each of which may be any APL variable. The components are referred to by their position within the file. Deletion of components or insertion of components within the file automatically renumbers the file in a manner similar to the renumbering of APL function lines during function editing. Files are created by the first valid write operation. Extensions to the built-in file functions allow information about the files, and their components to be read.

For each 'data space', the file system keeps tabs on the number of files each user owns and the size of those files. Each user has quotas which limit the number (if any) of files he may own, and the aggregate size of those files. In addition to the limits on a user, there are quota restrictions on the size of each individual file. The user is free to alter the default file size (which varies from system to system) upwards or downwards - subject, of course, to his overall quota.

Advanced File Operations

Each user of APLX can be allocated a user number (shown by 1↑⎕AI), which allows each user in a multi-user environment to assume a unique identity. Individual APLX files are tagged with a User Number, and have an associated File Access Matrix which indicates which users can access the file and what operations they may perform. Users will be allocated their user number by the logon procedure adopted by their system. Each user can thus 'own' a number of files and the user can grant or deny access to these files.

The Access Matrix is two columns wide. The first column is a list of user numbers - with 0 being taken to mean ALL users. The second column is a list of integers which indicate the access privileges for the indicated user. When a file is created, the default access matrix allows only the owner to access it, and grants to the owner all accesses except File-Delete. An Access matrix may have a maximum of 29 rows.

The access privileges can be given in two ways.

A positive privilege states what the user can do, and a negative privilege states what the user cannot do.

The privilege code is effectively a number generated by adding various powers of 2 (1,2,4,8,16,....), each power of 2 corresponding to a particular privilege. Positive privilege codes are merely the sum of the individual privileges granted, whilst negative privilege codes are generated by adding ¯1 and the result of negating the sum of all the privileges denied.

             Power of 2        Operation
              0    (1)         Read components
              1    (2)         1⍇ 2⍇ 3⍇
              2    (4)         Insert Components
              3    (8)         Append Components
              4    (16)        Replace Components
              5    (32)
              6    (64)        Delete a File
              7    (128)       Delete a Component
              8    (256)
              9    (512)       Set File Allocation
              10   (1024)      Rename
              11   (2048)      Hold/Release File
              12   (4096)      Hold/Release Components
              13   (8192)
              14   (16384)     6⍇ 7⍇
              15   (32768)     1⍇
              16   (65536)     2⍇
              17   (131072)    3⍇
              18   (262144)
              19   (524288)    Read Access Matrix
              20   (1048576)   Write Access Matrix

For example:

Privilege   Meaning 

     0      No Access 
     1      Read Only Access 
    17      Read and Replace Access 
    ¯1      Full Access 
   ¯65      All Operations except Delete allowed

In addition to the access privileges afforded to users by the Access matrix, the Hold mechanism temporarily suspends file access by other users, whilst, for example, an updating operation is being carried out. Hold may be applied and released to whole files or components, and holds may be applied in two strengths - write access restricted and both read and write restricted.

For more information, see the descriptions of the file-access primitives:

⍇ Read, Get info, Rename
⍈ Write
⍐ Hold/Release, Change Quota
⍗ Delete

Topic: APLX Help : Help on APL language : Component File Systems : ⍇ based File System
[ Next | Contents | Index | APL Home ]