Docsity

File System Interface: Concept, Structure, Attributes, Operations, and Organization, Slides of Operating Systems

Partial preview of the text

Download File System Interface: Concept, Structure, Attributes, Operations, and Organization and more Slides Operating Systems in PDF only on Docsity!

Chapter 10: File-System

Interface

File Concept

 Contiguous logical address space

 Types:

 Data  numeric  character  binary  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

File Operations

 File is an abstract data type

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

Sequential-access File

Simulation of Sequential Access on Direct-access File

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

Disk Structure

 Disk can be subdivided into partitions

 Disks or partitions can be RAID protected against failure

 Disk or partition can be used raw – without a file system, or formatted with a file system

 Partitions also known as minidisks, slices

 Entity containing file system known as a volume

 Each volume containing file system also tracks that file system’s info in device directory or volume table of contents

 As well as general-purpose file systems there are many special-purpose file systems, frequently all within the same operating system or computer

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, …)

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