Lesson 7 File System

Cards (30)

  • File
    Contiguous logical address space (physical may not be contiguous)
  • Types of files
    • Data (numeric, character, binary)
    • Program
  • File Attributes
    • Name
    • Identifier
    • Type
    • Location
    • Size
    • Protection
    • Time, date, and user identification
  • Information about files are kept in the directory structure, which is maintained on the disk
  • Many variations of file attributes, including extended file attributes (e.g. checksum)
  • File Operations
    • Create
    • Write
    • Read
    • Reposition within file (seek)
    • Delete
    • Truncate
    • Open
    • Close
  • Open File
    • Locate the file on the disk according to its file name (path)
    • Establish data structures to share file among different processes
    • Allocate file descriptor(ID-used by read/write requests)
  • Data structures for managing open files
    • Open-file table
    • File pointer
    • File-open count
    • Disk location of the file
    • Access rights
  • Classical Unix data structures for open files
    • Per Process Table of Open Files
    • System-wide File Table
    • System-wide V-Node Table (Linux –no V-node, only I-node)
  • Per Process Table of Open Files
    • File descriptor Flag
    • Ptr to entry in the System Wide File Table
  • System Wide Open File Table
    • File Status Flags
    • File offset(position of next read/write)
    • V-node ptr (entry in V-node table) or I-node ptr (entry in I-node table)
    1. Node Table
    • Type of file (regular, pipe, directory, etc)
    • Ptr to function operates such type of file
    • I-node info
    1. node
    • file type
    • access permissions
    • Owner and group owner
    • Size of the file
    • number of links
    • device number of the device where the file is stored
    • time of last access
    • time of last modification
    • time of last change to the i-node
    • block numbers of the blocks in which file is stored
  • Unix kernel, file is identified by its i-node number (not filename)
  • Unix directory file contains names of the files, their i-node numbers
  • Open File Locking
    • Shared lock
    • Exclusive lock
    • Mandatory
    • Advisory
  • File Locking Example - Java API
    • Shared lock
    • Exclusive lock
  • File Types
    • None (no structure) - sequence of words, bytes
    • Simple record structure (Lines, Fixed length, Variable length)
    • Complex Structures (Formatted document, Relocatable load file)
  • Access Methods
    • Sequential Access
    • Direct Access
  • Other Access Methods
    • Index for the file which contains pointer to the actual disk block
    • IBM indexed sequential-access method (ISAM)
    • VMS operating system provides index and relative files
  • Directory Structure
    • Search for a file
    • Create a file
    • Delete a file
    • List a directory
    • Rename a file
    • Traverse the file system
  • Directory Organization
    • Efficiency
    • Naming
    • Grouping
  • Single-Level Directory
    • Naming problem
    • Grouping problem
  • Two-Level Directory

    • Path name
    • Efficient searching
    • No grouping capability
  • Tree-Structured Directories
    • Efficient searching
    • Grouping Capability
    • Current directory (working directory)
    • Absolute or relative path name
    • Creating a new file
    • Deleting a file
    • Creating a new subdirectory
  • Acyclic-Graph Directories
    Have shared subdirectories and files
  • General Graph Directory
    • Cycles
    • Garbage collection
    • Cycle detection algorithm
  • File System Mounting
    Mount point
  • File Protection
    • Read
    • Write
    • Execute
    • Append
    • Delete
    • List
  • Access Lists and Groups
    • Mode of access: read, write, execute
    • Three classes of users: owner, group, public