SlideShare a Scribd company logo
Chapter 10:  File-System Interface
Files
File Concept & Structure  Contiguous persistent logical address space, can be storing data or programs File Structure: None - sequence of words, bytes Simple record structure Lines  Fixed length Variable length 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 Identifier  – unique tag (number) identifies file within file system Type  – needed for systems that support different types Location  – pointer to file location on device Size  – current file size Protection  – controls who can do reading, writing, executing Time, date, and user identification  – data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk
Example of File Attributes UNIX: ls -li 26047823 -rw-r--r--  1 Salim  staff  596480 Mar 16 20:17 Lecture10.ppt
File Operations File is an  abstract data type File operations: Create Write Read Reposition within file Delete Truncate Open(F i )  – search the directory structure on disk for entry  F i , and move the content of entry to memory Close (F i )  – move the content of entry  F i  in memory to directory structure on disk
Open Files Several pieces of data are needed to manage open files: File pointer:  pointer to last read/write location, per process that has the file open File-open count: counter of number of times a file is open – to allow removal of data from open-file table when last processes closes it Disk location of the file: cache of data access information Access rights: per-process access mode information
Open File Locking Provided by some operating systems and file systems Mediates access to a file Mandatory or advisory: Mandatory  – access is denied depending on locks held and requested Advisory  – processes can find status of locks and decide what to do
File Types – Name, Extension
Access Methods Sequential Access read next write next  reset no read after last write (rewrite) Direct Access read  n write  n position to  n read next write next  rewrite  n n  = relative block number
Sequential-access File
Simulation of Sequential Access on a Direct-access File
Example of Index and Relative Files
Directories
Directory Structure A collection of nodes containing information about all files F 1 F 2 F 3 F 4 F n Directory Files Both the directory structure and the files reside on disk Backups of these two structures are kept on tapes
A Typical File-system Organization
Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
Organize the Directory (Logically) to Obtain 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
Two-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability
Tree-Structured Directories
Tree-Structured Directories (Cont) Efficient searching Grouping Capability Current directory (working directory) cd /spell/mail/prog type list
Tree-Structured Directories (Cont) Absolute  or  relative  path name Creating a new file is done in current directory Delete a file rm <file-name> Creating a new subdirectory is done in current directory mkdir <dir-name> Example:  if in current directory  /mail mkdir count mail prog copy prt exp count Deleting “mail”    deleting the entire subtree rooted by “mail”
Acyclic-Graph Directories Have shared subdirectories and files
Acyclic-Graph Directories (Cont.) Two different names (aliasing) If  dict  deletes  list     dangling pointer Solutions: Backpointers, so we can delete all pointers Variable size records a problem Backpointers using a daisy chain organization Entry-hold-count solution New directory entry type Link  – another name (pointer) to an existing file Resolve the link  – follow pointer to locate the file
General Graph Directory
General Graph Directory (Cont.) How do we guarantee no cycles? Allow only links to file not subdirectories Garbage collection Every time a new link is added use a cycle detection algorithm to determine whether it is OK
File System Mounting A file system must be  mounted  before it can be accessed A unmounted file system (i.e. Fig. 11-11(b)) is mounted at a  mount point
(a) Existing.  (b) Unmounted Partition
Mount Point

More Related Content

PPT
PPTX
Naming Entities and Locating Mobile Entities
PPT
Files concepts.53
PDF
ITFT_File system interface in Operating System
PPTX
File system structure
PPT
PPTX
File system Os
PPTX
directory structure and file system mounting
Naming Entities and Locating Mobile Entities
Files concepts.53
ITFT_File system interface in Operating System
File system structure
File system Os
directory structure and file system mounting

What's hot (19)

PPT
Os10
PDF
File Systems
PDF
File system
PPTX
File System Implementation
PPTX
File Management – File Concept, access methods, File types and File Operation
PPTX
File Management in Operating System
PPT
PPTX
File System in Operating System
PDF
Unit ivos - file systems
PPTX
File system implementation
PPTX
Types of files
PPTX
File System Interface
PDF
File systems linux class 8
PDF
File management
PPTX
File management
PPTX
File management
PPTX
Operating system file system
PDF
File implementation
PPT
Os10
File Systems
File system
File System Implementation
File Management – File Concept, access methods, File types and File Operation
File Management in Operating System
File System in Operating System
Unit ivos - file systems
File system implementation
Types of files
File System Interface
File systems linux class 8
File management
File management
File management
Operating system file system
File implementation
Ad

Viewers also liked (10)

PPT
Korean War
PDF
Dependable Systems -Reliability Prediction (9/16)
PPT
PPTX
file sharing semantics by Umar Danjuma Maiwada
PPT
File models and file accessing models
PPTX
Types Of Buses
PDF
Intro to Buses (Computer Architecture)
PPT
Chapter 7 - Deadlocks
PPT
Chapter 17 - Distributed File Systems
PPTX
Types of buses of computer
Korean War
Dependable Systems -Reliability Prediction (9/16)
file sharing semantics by Umar Danjuma Maiwada
File models and file accessing models
Types Of Buses
Intro to Buses (Computer Architecture)
Chapter 7 - Deadlocks
Chapter 17 - Distributed File Systems
Types of buses of computer
Ad

Similar to Ch10 (20)

PPT
Ch11 OS
 
PPT
Chapter 10 - File System Interface
PPT
file management_osnotes.ppt
PPT
Unit 3 file management
PPTX
Filesth file handling in language dile
PPT
os unit-5-part2.ppt,Disk management file
PPT
Unit 3 chapter 1-file management
PDF
CH11.pdf
PPTX
File concept and access method
PPTX
Chapter 12.pptx
PPT
Operating System
PPTX
file_concept.pptx file presentation directories
PPTX
Learn about the File Concept in operating systems ppt
PPTX
file_concept.pptx file presentation directories
PPTX
operating system notes for file managment.pptx
PPTX
FILE MANAGEMENT.pptx
PDF
File structure
PPTX
DFSNov1.pptx
PPT
Understanding operating systems 5th ed ch08
Ch11 OS
 
Chapter 10 - File System Interface
file management_osnotes.ppt
Unit 3 file management
Filesth file handling in language dile
os unit-5-part2.ppt,Disk management file
Unit 3 chapter 1-file management
CH11.pdf
File concept and access method
Chapter 12.pptx
Operating System
file_concept.pptx file presentation directories
Learn about the File Concept in operating systems ppt
file_concept.pptx file presentation directories
operating system notes for file managment.pptx
FILE MANAGEMENT.pptx
File structure
DFSNov1.pptx
Understanding operating systems 5th ed ch08

More from tech2click (11)

PPT
Process Synchronization And Deadlocks
PPT
PPT
PPT
Tutorial4 Threads
PPT
Operating System 5
PPT
Mid1 Revision
PPT
Operating System 4
PPT
Operating System 3
PPT
Tutorial 2
PPT
Operating System 2
PPT
Rootkit
Process Synchronization And Deadlocks
Tutorial4 Threads
Operating System 5
Mid1 Revision
Operating System 4
Operating System 3
Tutorial 2
Operating System 2
Rootkit

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Modernizing your data center with Dell and AMD
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Modernizing your data center with Dell and AMD
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction

Ch10

  • 1. Chapter 10: File-System Interface
  • 3. File Concept & Structure Contiguous persistent logical address space, can be storing data or programs File Structure: None - sequence of words, bytes Simple record structure Lines Fixed length Variable length Complex Structures Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters Who decides: Operating system Program
  • 4. File Attributes Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file system Type – needed for systems that support different types Location – pointer to file location on device Size – current file size Protection – controls who can do reading, writing, executing Time, date, and user identification – data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk
  • 5. Example of File Attributes UNIX: ls -li 26047823 -rw-r--r-- 1 Salim staff 596480 Mar 16 20:17 Lecture10.ppt
  • 6. File Operations File is an abstract data type File operations: Create Write Read Reposition within file Delete Truncate Open(F i ) – search the directory structure on disk for entry F i , and move the content of entry to memory Close (F i ) – move the content of entry F i in memory to directory structure on disk
  • 7. Open Files Several pieces of data are needed to manage open files: File pointer: pointer to last read/write location, per process that has the file open File-open count: counter of number of times a file is open – to allow removal of data from open-file table when last processes closes it Disk location of the file: cache of data access information Access rights: per-process access mode information
  • 8. Open File Locking Provided by some operating systems and file systems Mediates access to a file Mandatory or advisory: Mandatory – access is denied depending on locks held and requested Advisory – processes can find status of locks and decide what to do
  • 9. File Types – Name, Extension
  • 10. Access Methods Sequential Access read next write next reset no read after last write (rewrite) Direct Access read n write n position to n read next write next rewrite n n = relative block number
  • 12. Simulation of Sequential Access on a Direct-access File
  • 13. Example of Index and Relative Files
  • 15. Directory Structure A collection of nodes containing information about all files F 1 F 2 F 3 F 4 F n Directory Files Both the directory structure and the files reside on disk Backups of these two structures are kept on tapes
  • 16. A Typical File-system Organization
  • 17. Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
  • 18. Organize the Directory (Logically) to Obtain 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, …)
  • 19. Single-Level Directory A single directory for all users Naming problem Grouping problem
  • 20. Two-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability
  • 22. Tree-Structured Directories (Cont) Efficient searching Grouping Capability Current directory (working directory) cd /spell/mail/prog type list
  • 23. Tree-Structured Directories (Cont) Absolute or relative path name Creating a new file is done in current directory Delete a file rm <file-name> Creating a new subdirectory is done in current directory mkdir <dir-name> Example: if in current directory /mail mkdir count mail prog copy prt exp count Deleting “mail”  deleting the entire subtree rooted by “mail”
  • 24. Acyclic-Graph Directories Have shared subdirectories and files
  • 25. Acyclic-Graph Directories (Cont.) Two different names (aliasing) If dict deletes list  dangling pointer Solutions: Backpointers, so we can delete all pointers Variable size records a problem Backpointers using a daisy chain organization Entry-hold-count solution New directory entry type Link – another name (pointer) to an existing file Resolve the link – follow pointer to locate the file
  • 27. General Graph Directory (Cont.) How do we guarantee no cycles? Allow only links to file not subdirectories Garbage collection Every time a new link is added use a cycle detection algorithm to determine whether it is OK
  • 28. File System Mounting A file system must be mounted before it can be accessed A unmounted file system (i.e. Fig. 11-11(b)) is mounted at a mount point
  • 29. (a) Existing. (b) Unmounted Partition