SlideShare uma empresa Scribd logo
1 de 14
File Management
Prepared By: Mr. S. A. Patil
Assistant Professor,PVPIT Budhgaon
File Concept
 Computer store information in various storage media
 OS provides a uniform logical view of information storage.
 These storage devises are nonvolatile.
 Physical properties of storage devices are mapped into logical view by OS called as
file.
 File is named collection of related information that is recorded on secondary
storage.
 Commonly files represent programs and data.
 Information in file defined by creator of file.
 In general file is sequence of bits, bytes, lines or records defined by user or creator.
File Attributes
 File attributes varies from one OS to another but typically consists of:
1. Name: string of character and symbolic file name is the only information kept in
human readable form.
2. Identifier : unique tag, usually a number identifies a file within a file system. It is
non human readable name for file.
3. Type: this information is needed for system to support different types of files.
4. Location: pointer to device and location of file on device.
5. Size: current size of file (bytes, words or blocks) and possibly maximum allowed
size is included in this attribute.
6. Protection: access control information determines who can do reading, writing,
executing and so on.
7. Time, Date and User identification: this information kept for creation, last
modification and last use. Useful for protection security and usage monitoring.
File Operations
 Six basic operations on files:
1. Creating a file: Two steps necessary for file creation. First find space for file in file
system. Second entry for a new file must be made in a directory.
2. Writing a file: To write into a file we make a system call specifying both file name
and content to write. Write pointer must be updated when write occurs.
3. Reading a file: To read from a file we make a system call specifying both file name
and where the block of the file should be put.
4. Repositioning within file: directory searched for the appropriate entry and the
current file-position-pointer is repositioned to given value. Need not any actual IO.
Also known as file seek.
File Operations
5. Deleting a File: To delete a file, we search directory for named entry. Having found
associated directory entry, we release all file space, so that it can be used by others.
6. Truncating a file: The user may want to erase content of file but keep its attributes.
Rater than deletion and recreation.
 Other common operations are
1. Appending
2. Renaming
3. copy
File Types
 Operating System recognize type of file and then operate on file in reasonable
ways.
 Technique for implement file types is to include the types as part of file name.
 Filename is divided into two parts file name and extension separated by period
character.
example: data.txt, add.c, server.java
 System uses extension to indicate type of file and type of operation that can be
done on that file.
File Types
1. Ordinary files
 These are the files that contain user information.
 These may have text, databases or executable program.
 The user can apply various operations on such files like add, modify, delete or even remove the
entire file.
2. Directory files
 These files contain list of file names and other information related to these files.
3. Special files
 These files are also known as device files.
 These files represent physical device like disks, terminals, printers, networks, tape drive etc.
 These files are of two types −
1. Character special files − data is handled character by character as in case of terminals or
printers.
2. Block special files − data is handled in blocks as in the case of disks and tapes.
File Structure
 File types can also be used to indicate internal structure of file.
 A File Structure should be according to a required format that the operating
system can understand and read.
1. A text file is a sequence of characters organized into lines.
2. A source file is a sequence of procedures and functions.
3. An object file is a sequence of bytes organized into blocks that are understandable
by the machine.
4. When operating system defines different file structures, it also contains the code to
support these file structure. Unix, MS-DOS support minimum number of file
structure.
Access Methods
 File store information
 Information must be accessed as needed and read into computer memory in
several ways
1. Sequential Access
 Simplest method.
 Information in the file is processed in order, one record after another.
 Editors and compilers usually access files in this fashion.
 Read command cause a pointer to be moved a head by one.
 Write command allocate space for the record and move the pointer to the new End
Of File.
 read next : reads next portion of file
 write next : writes to next portion of file
Access Methods
2. Direct Access (Relative Access)
 File is made up of fixed length of logical records that allow programs to read and
write records rapidly in no particular order.
 Based on disk model of a file.
 File is viewed as numbered sequence of blocks or records.
 Then we read block 14, then 34 and then block 5.
 No restriction on order of reading and writing of blocks.
 Used to immediate access of large amount of information.
 Databases.
 File operations as modified including block number as a parameter. Read n, write n
 Block number is provided by user to OS is a relative block number.
Access Methods
3. Other access Methods
 Built on top of the direct access method
 Involve index for a file.
 Index contains pointers to various blocks.
 To find a record in a file, we first search the index, then use pointer to access file
directly and to find desired record.
 With large file index file becomes too large to kept in memory. Solution is to create
index for index.
File management

Mais conteúdo relacionado

Mais procurados

File system Os
File system OsFile system Os
File system OsNehal Naik
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
ITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemBlossom Sood
 
File System in Operating System
File System in Operating SystemFile System in Operating System
File System in Operating SystemMeghaj Mallick
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mountingrajshreemuthiah
 
Database systems - Chapter 1
Database systems - Chapter 1Database systems - Chapter 1
Database systems - Chapter 1shahab3
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Database systems - Chapter 2
Database systems - Chapter 2Database systems - Chapter 2
Database systems - Chapter 2shahab3
 
Presentación: Sistema de Archivos Distribuido (DFS)
Presentación: Sistema de Archivos Distribuido (DFS)Presentación: Sistema de Archivos Distribuido (DFS)
Presentación: Sistema de Archivos Distribuido (DFS)Alejandro Rodríguez
 
File organization 1
File organization 1File organization 1
File organization 1Rupali Rana
 
File System Interface
File System InterfaceFile System Interface
File System Interfacechandinisanz
 
File system.
File system.File system.
File system.elyza12
 
Files concepts.53
Files concepts.53Files concepts.53
Files concepts.53myrajendra
 

Mais procurados (20)

File system Os
File system OsFile system Os
File system Os
 
Files
FilesFiles
Files
 
File system structure
File system structureFile system structure
File system structure
 
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
 
ITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating System
 
File System in Operating System
File System in Operating SystemFile System in Operating System
File System in Operating System
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mounting
 
File Management
File ManagementFile Management
File Management
 
File system
File systemFile system
File system
 
Database systems - Chapter 1
Database systems - Chapter 1Database systems - Chapter 1
Database systems - Chapter 1
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Database systems - Chapter 2
Database systems - Chapter 2Database systems - Chapter 2
Database systems - Chapter 2
 
Presentación: Sistema de Archivos Distribuido (DFS)
Presentación: Sistema de Archivos Distribuido (DFS)Presentación: Sistema de Archivos Distribuido (DFS)
Presentación: Sistema de Archivos Distribuido (DFS)
 
File organization 1
File organization 1File organization 1
File organization 1
 
File organisation
File organisationFile organisation
File organisation
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 
File Storage
File StorageFile Storage
File Storage
 
File system.
File system.File system.
File system.
 
Files concepts.53
Files concepts.53Files concepts.53
Files concepts.53
 

Semelhante a 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 pptgeethasenthil2706
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systemsdonny101
 
File concept and access method
File concept and access methodFile concept and access method
File concept and access methodrajshreemuthiah
 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file managementKalai Selvi
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file managementKalai Selvi
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File SystemSanthiNivas
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.pptHelalMirzad
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OSC.U
 

Semelhante a File management (20)

File
FileFile
File
 
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
 
File Systems
File SystemsFile Systems
File Systems
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systems
 
File concept and access method
File concept and access methodFile concept and access method
File concept and access method
 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
Chapter 12.pptx
Chapter 12.pptxChapter 12.pptx
Chapter 12.pptx
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
 
File structure
File structureFile structure
File structure
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File System
 
File system
File systemFile system
File system
 
OS Unit 4.pptx
OS Unit 4.pptxOS Unit 4.pptx
OS Unit 4.pptx
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
OS Unit IV.ppt
OS Unit IV.pptOS Unit IV.ppt
OS Unit IV.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.pptx
FILE MANAGEMENT.pptxFILE MANAGEMENT.pptx
FILE MANAGEMENT.pptx
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
 
OSCh11
OSCh11OSCh11
OSCh11
 

Mais de sangrampatil81

Mais de sangrampatil81 (20)

Deadlock
DeadlockDeadlock
Deadlock
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
IO hardware
IO hardwareIO hardware
IO hardware
 
Disk structure
Disk structureDisk structure
Disk structure
 
Directory structure
Directory structureDirectory structure
Directory structure
 
Directory implementation and allocation methods
Directory implementation and allocation methodsDirectory implementation and allocation methods
Directory implementation and allocation methods
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Monitors
MonitorsMonitors
Monitors
 
Classical problems of process synchronization
Classical problems of process synchronizationClassical problems of process synchronization
Classical problems of process synchronization
 
System programs
System programsSystem programs
System programs
 
System programs
System programsSystem programs
System programs
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
Operating system structure
Operating system structureOperating system structure
Operating system structure
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementation
 
Pointer to array and structure
Pointer to array and structurePointer to array and structure
Pointer to array and structure
 
Pointer arithmetic in c
Pointer arithmetic in c Pointer arithmetic in c
Pointer arithmetic in c
 
Pointer in c
Pointer in c Pointer in c
Pointer in c
 

Último

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Último (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

File management

  • 1. File Management Prepared By: Mr. S. A. Patil Assistant Professor,PVPIT Budhgaon
  • 2. File Concept  Computer store information in various storage media  OS provides a uniform logical view of information storage.  These storage devises are nonvolatile.  Physical properties of storage devices are mapped into logical view by OS called as file.  File is named collection of related information that is recorded on secondary storage.  Commonly files represent programs and data.  Information in file defined by creator of file.  In general file is sequence of bits, bytes, lines or records defined by user or creator.
  • 3. File Attributes  File attributes varies from one OS to another but typically consists of: 1. Name: string of character and symbolic file name is the only information kept in human readable form. 2. Identifier : unique tag, usually a number identifies a file within a file system. It is non human readable name for file. 3. Type: this information is needed for system to support different types of files. 4. Location: pointer to device and location of file on device. 5. Size: current size of file (bytes, words or blocks) and possibly maximum allowed size is included in this attribute. 6. Protection: access control information determines who can do reading, writing, executing and so on. 7. Time, Date and User identification: this information kept for creation, last modification and last use. Useful for protection security and usage monitoring.
  • 4. File Operations  Six basic operations on files: 1. Creating a file: Two steps necessary for file creation. First find space for file in file system. Second entry for a new file must be made in a directory. 2. Writing a file: To write into a file we make a system call specifying both file name and content to write. Write pointer must be updated when write occurs. 3. Reading a file: To read from a file we make a system call specifying both file name and where the block of the file should be put. 4. Repositioning within file: directory searched for the appropriate entry and the current file-position-pointer is repositioned to given value. Need not any actual IO. Also known as file seek.
  • 5. File Operations 5. Deleting a File: To delete a file, we search directory for named entry. Having found associated directory entry, we release all file space, so that it can be used by others. 6. Truncating a file: The user may want to erase content of file but keep its attributes. Rater than deletion and recreation.  Other common operations are 1. Appending 2. Renaming 3. copy
  • 6. File Types  Operating System recognize type of file and then operate on file in reasonable ways.  Technique for implement file types is to include the types as part of file name.  Filename is divided into two parts file name and extension separated by period character. example: data.txt, add.c, server.java  System uses extension to indicate type of file and type of operation that can be done on that file.
  • 7. File Types 1. Ordinary files  These are the files that contain user information.  These may have text, databases or executable program.  The user can apply various operations on such files like add, modify, delete or even remove the entire file. 2. Directory files  These files contain list of file names and other information related to these files. 3. Special files  These files are also known as device files.  These files represent physical device like disks, terminals, printers, networks, tape drive etc.  These files are of two types − 1. Character special files − data is handled character by character as in case of terminals or printers. 2. Block special files − data is handled in blocks as in the case of disks and tapes.
  • 8.
  • 9. File Structure  File types can also be used to indicate internal structure of file.  A File Structure should be according to a required format that the operating system can understand and read. 1. A text file is a sequence of characters organized into lines. 2. A source file is a sequence of procedures and functions. 3. An object file is a sequence of bytes organized into blocks that are understandable by the machine. 4. When operating system defines different file structures, it also contains the code to support these file structure. Unix, MS-DOS support minimum number of file structure.
  • 10. Access Methods  File store information  Information must be accessed as needed and read into computer memory in several ways 1. Sequential Access  Simplest method.  Information in the file is processed in order, one record after another.  Editors and compilers usually access files in this fashion.  Read command cause a pointer to be moved a head by one.  Write command allocate space for the record and move the pointer to the new End Of File.  read next : reads next portion of file  write next : writes to next portion of file
  • 11. Access Methods 2. Direct Access (Relative Access)  File is made up of fixed length of logical records that allow programs to read and write records rapidly in no particular order.  Based on disk model of a file.  File is viewed as numbered sequence of blocks or records.  Then we read block 14, then 34 and then block 5.  No restriction on order of reading and writing of blocks.  Used to immediate access of large amount of information.  Databases.  File operations as modified including block number as a parameter. Read n, write n  Block number is provided by user to OS is a relative block number.
  • 12.
  • 13. Access Methods 3. Other access Methods  Built on top of the direct access method  Involve index for a file.  Index contains pointers to various blocks.  To find a record in a file, we first search the index, then use pointer to access file directly and to find desired record.  With large file index file becomes too large to kept in memory. Solution is to create index for index.