Filesystem

File system interface and stream-based I/O #

Scope #

  • File concept. File structures, attributes and basic operations.
  • Opening file. File session. File locking.
  • File access modes: sequential, direct (random access), indexed.
  • File system organization: partitions, directories, formatting
  • Directory organization: goals and implementations: single-level, 2-level tree-structured, acyclic-graph structured and generic graphs.
  • File system mounting.
  • File sharing: concept, semantics, protection.

Low-level POSIX API:

  • Opening and closing file session: open(), close()
  • File attributes in Unix and attribute reading functions: stat(), lstat(),fstat()
  • Descriptor-based synchronous read/write: read(), write()
  • File positioning: lseek()
  • Descriptor duplicates: dup(), dup2()
  • Changes in arrays of: descriptors, open files and i-nodes raled to calling open(), dup()/dup2(), fork()
  • Waiting on descriptors: select()
  • File streams and descriptors: fdopen(), fileno()
  • Synchronized I/O: fsync(), sync()

Standard C API:

  • Streams and descriptor-based I/O.
  • Stream buffering.
  • Opening/closing streams. Stream EOF and error condition indications
  • Stream positioning and read/write operations.
  • POSIX directories: concept, working directory, root directory.
  • Directory stream related operations.

Reference #

  1. Textbook: “File system interface - chapter 11”
  2. Lecture presentation (PDF)
  3. Lecture code samples
  4. The GNU C library documentation: Input/output concepts
  5. The GNU C library documentation: Low-Level Input/Output (13.1-13.5,13.8)
  6. Excerpts from POSIX IEEE Std 1003.1 2017 - POSIX definitions related to processes
  7. Old Slides: FS_interface.pdf, IO_1.pdf, Slides: IO_2.pdf