SlideShare a Scribd company logo
1 of 26
File Concept, File Management, File




                                      1
Recap


In the last class, you have learnt:

• File and File operations




                       9CM 402.54     2
• HOME     PREVIOUS TOPIC NEXT
• PREVIOUS QUESTION PAPERS FOR
  OS
• CPP TUTORIALS




                                 3
Objective(s)

On completion of this period, you would be able to:

• Understand the different file access methods
• Introduction to directory




                      9CM 402.54                  4
Introduction

•   Files store information

•   This information must be accessed and read into
    computer memory for use

•   There are different access methods

•   Some systems support only one access method

•   Other systems support different access methods

                       9CM 402.54                5
Types of Access Methods


•   Sequential Access

•   Direct Access

•   Other Access Methods




                    9CM 402.54      6
Sequential Access

•   Simplest access method
•   Information processed in order
•   Most common
•   Used by editors and compilers
•   Based on a tape model of a file
•   Works well on sequential access devices and
    random access devices
                      9CM 402.54                  7
Sequential Access


                     current position
beginning                                               end




            rewind
                                        read or write



              Fig : Sequential Access File




                       9CM 402.54                             8
Most Common Operations on Files

•   Read

•   Write




               9CM 402.54         9
File Pointer


• Whenever a file is opened for read or write

  operation a file pointer is maintained to keep

  track of the current position in the file




                        9CM 402.54                 10
Read operation

•   Reads the next portion of the file

•   Automatically advances file pointer




                 9CM 402.54               11
Write operation

• Appends data to the end of the file

• Advances pointer to the new end of file




                   9CM 402.54               12
Reset

•   Reset to beginning




                     9CM 402.54   13
Skip

• Skip n records forwards or backwards
     ( supported by few systems )




                     9CM 402.54          14
Applications for sequential access

• Payroll of employees

• Student data processing




                 9CM 402.54           15
Direct Access

• Also known as Relative Access
• Fixed length logical records
• No particular order for read and write
• Based on disk model of a file
• File viewed as a numbered sequence of blocks or
  records
• Arbitrary block read or written

                       9CM 402.54              16
Direct Access


• Useful for immediate access to large volumes of

  data

• Most suitable for database applications

• Easy to read, write and delete a record



                      9CM 402.54                17
Direct Access



•Address of arbitrary record N
 Let length of logical record = L
 Address of record N = L*(N-1)




                       9CM 402.54   18
Simulate Sequential Access


• Easy to simulate sequential access on direct

  access file

• Keep a variable cp i.e. Current position




                      9CM 402.54                 19
Simulate Sequential Access

 Sequential Access             Implementation for
                               direct access
           reset               cp := 0
         read next             read cp
                               cp := cp + 1
         write next            write cp
                               cp := cp + 1

Fig : Simulation of sequential access on a direct access file



                         9CM 402.54                             20
Applications for Direct access

• Airline reservation system

• Customer account processing in a bank




                    9CM 402.54            21
Other Access Methods


• Built on top of direct access method

• Require the construction of an index for the file

• Index is a small table stored in memory

• The index contains pointers to various blocks




                       9CM 402.54                     22
To find an entry in the file…


• Search the index

• Use the pointer to access the file directly

 for the desired entry




                 9CM 402.54                     23
To find an entry in the file
                logical record
last name
                      number
  Adams

  Arthur

  Asher                                 Smith,       John SSN
                                         Age
     .
     .
     .
  Smith                                          relative file



         index file

                           9CM 402.54                            24
Primary index and Secondary index

• With large files index file itself too large to
  be in memory

• Solution is create index for the index file

• Primary index points to secondary index

• Secondary index points to actual data

                   9CM 402.54                       25
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

More Related Content

What's hot

directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mountingrajshreemuthiah
 
Input output organization
Input output organizationInput output organization
Input output organizationabdulugc
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stackAsif Iqbal
 
File organization 1
File organization 1File organization 1
File organization 1Rupali Rana
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Shuvongkor Barman
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating SystemJanki Shah
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security ArchitectureBharathiKrishna6
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 

What's hot (20)

directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mounting
 
Input output organization
Input output organizationInput output organization
Input output organization
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
Deadlock
DeadlockDeadlock
Deadlock
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stack
 
File organization 1
File organization 1File organization 1
File organization 1
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
File management
File managementFile management
File management
 
Modes of transfer
Modes of transferModes of transfer
Modes of transfer
 
RAID LEVELS
RAID LEVELSRAID LEVELS
RAID LEVELS
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 

Viewers also liked (15)

Handling computer files
Handling computer filesHandling computer files
Handling computer files
 
Kernel I/O subsystem
Kernel I/O subsystemKernel I/O subsystem
Kernel I/O subsystem
 
Cpu registers
Cpu registersCpu registers
Cpu registers
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Spring Boot with Quartz
Spring Boot with QuartzSpring Boot with Quartz
Spring Boot with Quartz
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
Memory management
Memory managementMemory management
Memory management
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
 
Docker allocating resources
Docker allocating resourcesDocker allocating resources
Docker allocating resources
 
Registers
RegistersRegisters
Registers
 
5. boot process
5. boot process5. boot process
5. boot process
 
File organization
File organizationFile organization
File organization
 
Search engines and its types
Search engines and its typesSearch engines and its types
Search engines and its types
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 

Similar to File access methods.54

Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthLeveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthPerforce
 
Introduction to Memory-Style Storage in Linux
Introduction to Memory-Style Storage in LinuxIntroduction to Memory-Style Storage in Linux
Introduction to Memory-Style Storage in LinuxClay (Chih-Hao) Chang
 
31 address binding, dynamic loading
31 address binding, dynamic loading31 address binding, dynamic loading
31 address binding, dynamic loadingmyrajendra
 
Workshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityWorkshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityAndrew Case
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerMongoDB
 
Memory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual MachineMemory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual MachineAndrew Case
 
Hadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHanborq Inc.
 
NTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC PresentationNTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC PresentationMuhamad Hesham
 
Performance Enhancement with Pipelining
Performance Enhancement with PipeliningPerformance Enhancement with Pipelining
Performance Enhancement with PipeliningAneesh Raveendran
 

Similar to File access methods.54 (20)

Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network BandwidthLeveraging Structured Data To Reduce Disk, IO & Network Bandwidth
Leveraging Structured Data To Reduce Disk, IO & Network Bandwidth
 
AFS case study
AFS case studyAFS case study
AFS case study
 
Introduction to Memory-Style Storage in Linux
Introduction to Memory-Style Storage in LinuxIntroduction to Memory-Style Storage in Linux
Introduction to Memory-Style Storage in Linux
 
31 address binding, dynamic loading
31 address binding, dynamic loading31 address binding, dynamic loading
31 address binding, dynamic loading
 
Workshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityWorkshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with Volatility
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTiger
 
Cache
CacheCache
Cache
 
Ch 8 data base
Ch 8 data baseCh 8 data base
Ch 8 data base
 
Chapter-5-DFS.ppt
Chapter-5-DFS.pptChapter-5-DFS.ppt
Chapter-5-DFS.ppt
 
Java I/O
Java I/OJava I/O
Java I/O
 
5263802.ppt
5263802.ppt5263802.ppt
5263802.ppt
 
Memory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual MachineMemory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual Machine
 
Hadoop HDFS Detailed Introduction
Hadoop HDFS Detailed IntroductionHadoop HDFS Detailed Introduction
Hadoop HDFS Detailed Introduction
 
O svv92014
O svv92014O svv92014
O svv92014
 
Hdfs architecture
Hdfs architectureHdfs architecture
Hdfs architecture
 
NTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC PresentationNTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC Presentation
 
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux KernelChapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux Kernel
 
Domino testing presentation
Domino testing presentationDomino testing presentation
Domino testing presentation
 
Performance Enhancement with Pipelining
Performance Enhancement with PipeliningPerformance Enhancement with Pipelining
Performance Enhancement with Pipelining
 
COA notes
COA notesCOA notes
COA notes
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

File access methods.54

  • 1. File Concept, File Management, File 1
  • 2. Recap In the last class, you have learnt: • File and File operations 9CM 402.54 2
  • 3. • HOME PREVIOUS TOPIC NEXT • PREVIOUS QUESTION PAPERS FOR OS • CPP TUTORIALS 3
  • 4. Objective(s) On completion of this period, you would be able to: • Understand the different file access methods • Introduction to directory 9CM 402.54 4
  • 5. Introduction • Files store information • This information must be accessed and read into computer memory for use • There are different access methods • Some systems support only one access method • Other systems support different access methods 9CM 402.54 5
  • 6. Types of Access Methods • Sequential Access • Direct Access • Other Access Methods 9CM 402.54 6
  • 7. Sequential Access • Simplest access method • Information processed in order • Most common • Used by editors and compilers • Based on a tape model of a file • Works well on sequential access devices and random access devices 9CM 402.54 7
  • 8. Sequential Access current position beginning end rewind read or write Fig : Sequential Access File 9CM 402.54 8
  • 9. Most Common Operations on Files • Read • Write 9CM 402.54 9
  • 10. File Pointer • Whenever a file is opened for read or write operation a file pointer is maintained to keep track of the current position in the file 9CM 402.54 10
  • 11. Read operation • Reads the next portion of the file • Automatically advances file pointer 9CM 402.54 11
  • 12. Write operation • Appends data to the end of the file • Advances pointer to the new end of file 9CM 402.54 12
  • 13. Reset • Reset to beginning 9CM 402.54 13
  • 14. Skip • Skip n records forwards or backwards ( supported by few systems ) 9CM 402.54 14
  • 15. Applications for sequential access • Payroll of employees • Student data processing 9CM 402.54 15
  • 16. Direct Access • Also known as Relative Access • Fixed length logical records • No particular order for read and write • Based on disk model of a file • File viewed as a numbered sequence of blocks or records • Arbitrary block read or written 9CM 402.54 16
  • 17. Direct Access • Useful for immediate access to large volumes of data • Most suitable for database applications • Easy to read, write and delete a record 9CM 402.54 17
  • 18. Direct Access •Address of arbitrary record N Let length of logical record = L Address of record N = L*(N-1) 9CM 402.54 18
  • 19. Simulate Sequential Access • Easy to simulate sequential access on direct access file • Keep a variable cp i.e. Current position 9CM 402.54 19
  • 20. Simulate Sequential Access Sequential Access Implementation for direct access reset cp := 0 read next read cp cp := cp + 1 write next write cp cp := cp + 1 Fig : Simulation of sequential access on a direct access file 9CM 402.54 20
  • 21. Applications for Direct access • Airline reservation system • Customer account processing in a bank 9CM 402.54 21
  • 22. Other Access Methods • Built on top of direct access method • Require the construction of an index for the file • Index is a small table stored in memory • The index contains pointers to various blocks 9CM 402.54 22
  • 23. To find an entry in the file… • Search the index • Use the pointer to access the file directly for the desired entry 9CM 402.54 23
  • 24. To find an entry in the file logical record last name number Adams Arthur Asher Smith, John SSN Age . . . Smith relative file index file 9CM 402.54 24
  • 25. Primary index and Secondary index • With large files index file itself too large to be in memory • Solution is create index for the index file • Primary index points to secondary index • Secondary index points to actual data 9CM 402.54 25
  • 26. Other subject materials • Web designing • Micro processors • C++ tutorials • java home