5.4. File System Services

5.4.1. Types of File Access

5.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.

5.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.

5.4.2. Permissions

../_images/permissions.png

An import attribute of files is their set of permissions.

5.4.3. File Descriptors

../_images/open_file.png

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

5.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

5.4.5. Directory Trees

../_images/dir_tree.png

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

5.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.