Docsity

File Systems and Disk Operations: Structures, Access Methods, and Allocation Schemes, Slides of Operating Systems

Partial preview of the text

Download File Systems and Disk Operations: Structures, Access Methods, and Allocation Schemes and more Slides Operating Systems in PDF only on Docsity!

FILE-SYSTEM INTERFACE

File Concept Access Methods Directory Structure File System Mounting File Sharing Protection

File Concept

  • Contiguous logical address space
  • Types:
    • Data
      • numeric
      • character
      • binary
    • Program

File Structure

  • Complex Structures
    • Formatted document
    • Relocatable load file
  • Can simulate last two with first method by inserting appropriate control characters.
  • Who decides:
    • Operating system
    • Program

File Attributes

  • Name – only information kept in human- readable form.
  • Type – needed for systems that support different types.
  • Location – pointer to file location on device.
  • Size – current file size.

File Operations

  • Create
  • Write
  • Read
  • Reposition within file – file seek
  • Delete

File Operations

  • Truncate
  • Open(Fi)
    • search the directory structure on disk for entry Fi,
    • move the content of entry to memory.
  • Close (Fi)
    • move the content of entry Fi in memory to directory structure on disk.

Access Methods

  • Sequential Access:
    • read next
    • write next
    • reset
    • no read after last write
    • (rewrite)

Access Methods

  • Direct Access:

read n write n position to n read next write next rewrite n

n = relative block number Docsity.com

Simulation of Seq. Access on a Direct-

access File

Example of Index and Relative Files

A Typical File-system Organization

Information in a Device Directory

  • Name
  • Type
  • Address
  • Current length
  • Maximum length
  • Date last accessed (for archival)
  • Date last updated (for dump)
  • Owner ID (who pays)
  • Protection information (discuss later) Docsity.com

Logical Directory Organization

  • Efficiency – locating a file quickly.
  • Naming – convenient to users.
    • Two users can have same name for different files.
    • The same file can have several different names.
  • Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …)

Single-Level Directory

  • A single directory for all users.

Naming problem

Grouping problem