File Access Methods (FAM)


FAM:   SOLD       




1. Sequential Access

When used, file storage information must be accessible and readable into the computer's memory. Some systems provide only one access method for files. In other systems, like IBM, multiple access methods are supported. The challenge in these systems is choosing the most suitable one for a particular application.

Sequential Access is the simplest method. Information stored in a file is processed in order. The basic operations on a file are read and write. A read operation reads the file and advances the file pointer along the I/O path. A write operation appends data to the end of the file and advances the pointer to the new end. This method is based on the tape model and works for both sequential and random access devices.

2. Direct Access

Direct Access allows programs to quickly read and write files created with fixed-length logical records, without following a specific order. This method is especially useful for accessing large volumes of information. Databases commonly use this method. File operations in this method must be modified to include a block number as a parameter. Users provide the block number to the operating system, typically as a relative block number (an index relative to the beginning of the file). Using relative block numbers helps the OS decide where to place the file and prevents users from accessing unauthorized parts of the file system.

3. Indexed Access

This method is an enhancement of direct access, adding an index to access the file. To retrieve information, the system first searches the index, then uses a pointer to access the file and retrieve the data. However, a drawback of this method is that the file index grows with large files. To address this, two levels of indexing are used: primary and secondary indexes. The primary index points to the secondary index, which then points to the actual data.

Understanding File Protection

When storing information in a computer system, two primary concerns arise:

  1. System Reliability
    System reliability refers to the ability to protect stored information from damage, including physical protection of files. Reliability can be maintained by creating manual or automatic backups, depending on the operating system’s services. System reliability is further discussed in Section 6.10.

  2. File Protection
    Protecting files involves various mechanisms. One essential method is controlling access to files. File access control allows the file owner to define which operations other users can perform on the file. This control is implemented using permissions that can either allow or deny specific actions. The following file operations can have access restrictions:

  3. Read: Reading from the file.

  4. Write: Writing to the file.
  5. Execute: Loading the file into memory for execution.
  6. Append: Adding information to the end of the file.
  7. Delete: Removing the file.
  8. List: Listing the file's properties.
  9. Rename: Changing the file's name.
  10. Copy: Duplicating the file.
  11. Edit: Modifying the file.


Each protection mechanism has pros and cons, and the choice depends on system requirements and specifications.

4. Access Lists and Groups

A common protection system bases access on user identity. An access list contains information about each user and the permissions they have for the file. This list is checked whenever a user requests file access. If the user has the necessary permissions, access is granted; otherwise, the system issues a Protection Violation warning.

A challenge with access lists is their potential length, as all users must be registered in the list for each file. This leads to two issues:

  • Creating lengthy access lists can be tedious, especially when the number of users is unknown.
  • Managing hard disk space becomes more complex, as directory sizes fluctuate.


To mitigate this, a shorter access list technique is used, categorizing users into:

  • Owner: The user who created the file.
  • Group: A set of users with the same access rights to the file.
  • Universe: All users on the system.


In UNIX systems, file protection uses three fields represented by bits (rwx):

  • r: Read access control.
  • w: Write access control.
  • x: Execute access control.


Below is an example of an access list in UNIX:

drwxrwxrwx1pbgstaff512Apr 16 22:25file.txt
ownergroupuniversegroupownersizetimefilename


5. Other Protection Approaches

Another common protection method is using passwords for files. Some operating systems apply this not only to files but also to directories. With this system, only users who know the file's password can access it. However, this approach has two challenges:

  • Users must remember multiple passwords for file access.
  • Password security can be compromised. If a single password is leaked, it poses a significant risk, necessitating unique passwords for different files and levels.

Post a Comment

Previous Next

نموذج الاتصال