6.4. File System Services

6.4.1. Types of File Access

6.4.1.1. Sequential Access

../_images/sequential_access.png

Most files are accessed in linear manner from the beginning. It is possible to repositon (seek system call) the current file position pointer.

6.4.1.2. Direct Access

../_images/direct_access.png

File systems that are optimized for use with data bases are accessed in terms of records rather than a byte sequence.

6.4.2. Permissions

../_images/permissions.png

An import attribute of files is their set of permissions.

6.4.3. File Descriptors

../_images/open_file.png

The set of open files for each process is tracked in the process control block (PCB).

6.4.4. System Calls

  • Create a file
  • Delete a file
  • Open a file
  • Close a file
  • Read data from a file
  • Write data to a file
  • Reposition the current file pointer in a file
  • Append data to the end of a file
  • Truncate a file (delete its contents)
  • Rename a file
  • Copy a file

6.4.5. Directory Trees

../_images/dir_tree.png

The notion of directories allows files and directories to be organized in a tree like manner.

6.4.6. Path Names

An absolute path name begins at the root and specifies each step down the tree until it reaches the desired file or directory.

A relative path name begins from the current working directory.