SlideShare a Scribd company logo
1 of 16
File concept &
access method
R.Pavithra MSc-IT
Nadar saraswathi college
of arts and science,
Theni.
CONTENTS
 File Concept
 Access Methods
OBJECTIVES
 To explain the function of file systems
 To describe the interfaces to file systems
 To discuss file-system design tradeoffs,
including access methods, file sharing, file
locking, and directory structure.
 To explore file-system protection
File Concept
 Uniform logical view of information storage (no matter the
medium)
 OS abstracts from physical properties into a logical storage
unit, the file
 Files mapped onto physical devices, usually nonvolatile
 File is a collection of related information
◦ Smallest allotment of nameable storage
 Contiguous logical address space
 Types:
◦ Data
 numeric
 character
 binary
◦ Program
◦ May be free form or rigidly formed (structured)
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 / programmer
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
◦ Typically file’s name and identifier
 Identifier locates other file attributes
 Attributes may be > 1KB
 Directory structures may be > 1MB
File Operations
 File is an abstract data type
 Operations include the following (and usually
more)
 Create – find space, add entry to directory
 Write – write data at current file position
pointer location and update pointer
 Read – read file contents at pointer location,
update pointer
 Reposition within file (seek) – change
pointer location
 Delete – free space and remove entry from
directory
 Truncate – delete data starting at pointer
Open Files
 Open(Fi) – allow process to access a file
◦ Returns a file handle for system call reference
to the file
◦ Search the directory structure on disk for entry
Fi, and move the content or cache some of
entry to memory
 Close(file handle) – end processes’ access to the
file
◦ Move the content of entry Fi in memory to
directory structure on disk
Open File Data Structures
 Usually a global table containing process-independent open file
information
◦ Size
◦ Access dates
◦ Disk location of the file: cache of data access information
◦ 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
Per-process open file table contains pertinent info, plus pointer to entry in global open file table
◦ Current file position pointer: pointer to next read/write location
◦ Access rights: per-process access mode information
 read, write, append
Open File Locking
 Provided by some operating systems and file systems
 Mediates access to a file
◦ shared
◦ exclusive
 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
 Most operating systems recognize file types
◦ Filename extension
◦ I.e. resume.doc, server.java, readerthread.c
 Most support them
◦ Automatically open a type of file via a specific application (.doc)
◦ Only execute files of a given extension (.exe, .com)
◦ Run files of a given type via a scripting language (.bat)
 Can get more advanced
◦ If source code modified since executable compiled, if attempt made to
execute, recompile and then execute (TOPS-20)
◦ Mac OS encodes creating program’s name in file attributes
 Double clicking on file passes the file name to appropriate application
◦ Unix has magic number stored in file at first byte indicating file type
Access Methods
 Sequential Access – tape
model of a file
read next
write next
reset
no read after last write
(rewrite)
 Direct Access – random
access, relative access
read n
write n
position to n
read next
write next
rewrite n
n = relative block number
 Can accommodate
structured data in
file by mapping
record number to
block number
 Oses usually
support both kinds,
sometimes require
access method
declaration during
create()
Sequential-access File
Simulation of Sequential Access
on Direct-access File
Example of Index and Relative
Files
T
H
A
N
K
I
N
G
Y
O
U

More Related Content

What's hot

File Management – File Concept, access methods, File types and File Operation
File Management – File Concept, access methods,  File types and File OperationFile Management – File Concept, access methods,  File types and File Operation
File Management – File Concept, access methods, File types and File OperationDhrumil Panchal
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Multithreading
MultithreadingMultithreading
MultithreadingA B Shinde
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
File system Os
File system OsFile system Os
File system OsNehal Naik
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)Computer_ at_home
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
File management
File managementFile management
File managementMohd Arif
 
Computer architecture page replacement algorithms
Computer architecture page replacement algorithmsComputer architecture page replacement algorithms
Computer architecture page replacement algorithmsMazin Alwaaly
 

What's hot (20)

File Management – File Concept, access methods, File types and File Operation
File Management – File Concept, access methods,  File types and File OperationFile Management – File Concept, access methods,  File types and File Operation
File Management – File Concept, access methods, File types and File Operation
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
File system structure
File system structureFile system structure
File system structure
 
System calls
System callsSystem calls
System calls
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
 
File system Os
File system OsFile system Os
File system Os
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
File management
File managementFile management
File management
 
Deadlock
DeadlockDeadlock
Deadlock
 
File system
File systemFile system
File system
 
Files
FilesFiles
Files
 
Disk structure
Disk structureDisk structure
Disk structure
 
Computer architecture page replacement algorithms
Computer architecture page replacement algorithmsComputer architecture page replacement algorithms
Computer architecture page replacement algorithms
 
Run time storage
Run time storageRun time storage
Run time storage
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 

Similar to File concept and access method

Similar to File concept and access method (20)

Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
 
Learn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptLearn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems ppt
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Ch10
Ch10Ch10
Ch10
 
File management
File managementFile management
File management
 
File Management
File ManagementFile Management
File Management
 
File Systems
File SystemsFile Systems
File Systems
 
File system interface
File system interfaceFile system interface
File system interface
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File System
 
CH11.pdf
CH11.pdfCH11.pdf
CH11.pdf
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Os6
Os6Os6
Os6
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
 
FILE MANAGEMENT.pptx
FILE MANAGEMENT.pptxFILE MANAGEMENT.pptx
FILE MANAGEMENT.pptx
 
OSCh11
OSCh11OSCh11
OSCh11
 
OS_Ch11
OS_Ch11OS_Ch11
OS_Ch11
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 

More from rajshreemuthiah (20)

oracle
oracleoracle
oracle
 
quality
qualityquality
quality
 
bigdata
bigdatabigdata
bigdata
 
polymorphism
polymorphismpolymorphism
polymorphism
 
solutions and understanding text analytics
solutions and understanding text analyticssolutions and understanding text analytics
solutions and understanding text analytics
 
interface
interfaceinterface
interface
 
Testing &ampdebugging
Testing &ampdebuggingTesting &ampdebugging
Testing &ampdebugging
 
concurrency control
concurrency controlconcurrency control
concurrency control
 
Education
EducationEducation
Education
 
Formal verification
Formal verificationFormal verification
Formal verification
 
Transaction management
Transaction management Transaction management
Transaction management
 
Multi thread
Multi threadMulti thread
Multi thread
 
System testing
System testingSystem testing
System testing
 
software maintenance
software maintenancesoftware maintenance
software maintenance
 
exception handling
exception handlingexception handling
exception handling
 
e governance
e governancee governance
e governance
 
recovery management
recovery managementrecovery management
recovery management
 
Implementing polymorphism
Implementing polymorphismImplementing polymorphism
Implementing polymorphism
 
Buffer managements
Buffer managementsBuffer managements
Buffer managements
 
os linux
os linuxos linux
os linux
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

File concept and access method

  • 1. File concept & access method R.Pavithra MSc-IT Nadar saraswathi college of arts and science, Theni.
  • 3. OBJECTIVES  To explain the function of file systems  To describe the interfaces to file systems  To discuss file-system design tradeoffs, including access methods, file sharing, file locking, and directory structure.  To explore file-system protection
  • 4. File Concept  Uniform logical view of information storage (no matter the medium)  OS abstracts from physical properties into a logical storage unit, the file  Files mapped onto physical devices, usually nonvolatile  File is a collection of related information ◦ Smallest allotment of nameable storage  Contiguous logical address space  Types: ◦ Data  numeric  character  binary ◦ Program ◦ May be free form or rigidly formed (structured)
  • 5. 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 / programmer
  • 6. 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 ◦ Typically file’s name and identifier  Identifier locates other file attributes  Attributes may be > 1KB  Directory structures may be > 1MB
  • 7. File Operations  File is an abstract data type  Operations include the following (and usually more)  Create – find space, add entry to directory  Write – write data at current file position pointer location and update pointer  Read – read file contents at pointer location, update pointer  Reposition within file (seek) – change pointer location  Delete – free space and remove entry from directory  Truncate – delete data starting at pointer
  • 8. Open Files  Open(Fi) – allow process to access a file ◦ Returns a file handle for system call reference to the file ◦ Search the directory structure on disk for entry Fi, and move the content or cache some of entry to memory  Close(file handle) – end processes’ access to the file ◦ Move the content of entry Fi in memory to directory structure on disk
  • 9. Open File Data Structures  Usually a global table containing process-independent open file information ◦ Size ◦ Access dates ◦ Disk location of the file: cache of data access information ◦ 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 Per-process open file table contains pertinent info, plus pointer to entry in global open file table ◦ Current file position pointer: pointer to next read/write location ◦ Access rights: per-process access mode information  read, write, append
  • 10. Open File Locking  Provided by some operating systems and file systems  Mediates access to a file ◦ shared ◦ exclusive  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
  • 11. File Types  Most operating systems recognize file types ◦ Filename extension ◦ I.e. resume.doc, server.java, readerthread.c  Most support them ◦ Automatically open a type of file via a specific application (.doc) ◦ Only execute files of a given extension (.exe, .com) ◦ Run files of a given type via a scripting language (.bat)  Can get more advanced ◦ If source code modified since executable compiled, if attempt made to execute, recompile and then execute (TOPS-20) ◦ Mac OS encodes creating program’s name in file attributes  Double clicking on file passes the file name to appropriate application ◦ Unix has magic number stored in file at first byte indicating file type
  • 12. Access Methods  Sequential Access – tape model of a file read next write next reset no read after last write (rewrite)  Direct Access – random access, relative access read n write n position to n read next write next rewrite n n = relative block number  Can accommodate structured data in file by mapping record number to block number  Oses usually support both kinds, sometimes require access method declaration during create()
  • 14. Simulation of Sequential Access on Direct-access File
  • 15. Example of Index and Relative Files