Professional Documents
Culture Documents
Index
Definition of OS File and related terms Purpose of File Management Operations on File File Allocation Methods File Organization
Operating System
An operating system is software, consisting of programs and data, that runs on computers, manages computer hardware resources, and pro ides common ser ices for execution of arious application software! A program that acts as an intermediary "etween a user of a computer and the computer hardware!
Functions of OS
Process Management Memory Management I#O Management Secondary Storage Management File Management
$hat is File
A file is a collection of related information defined "y its creator! Files represent programs %"oth source and o"&ect forms' and data!
/ the 0le1s size, in "ytes and#or "loc-s, / any limits set on the 0le1s size, / the primary owner of the 0le, / information a"out other potential users of this 0le, / access constraints on the owner and other users, / dates and times of creation, last access and last modi0cation, / dates and times of last "ac-up and reco ery,
4ecord
)ollection of related fields *reated as a unit
,xample+ employee record
Data"ase
)ollection of related data 4elationships exist among elements
File Management
*he operating system is responsi"le for the following acti ities in connections with file management+ File creation and deletion! Directory creation and deletion! Support for manipulating files and directories! Mapping files onto secondary storage! File "ac-up on sta"le %non olatile' storage media!
File Management
/ Identify and locate a selected file / 2se a directory to descri"e the location of all files plus their attri"utes / On a shared system descri"e user access control / 3loc-ing for access to files / Allocate files to free "loc-s / Manage free storage for a aila"le "loc-s!
File Operations
)reate Delete Open )lose 4ead $rite
*ypical Operations
Retrieve_All + 4etrie e all the records of a file! *his operation will "e re6uired for an application that must process all the information in the file at one time! Retrieve_One + *his operation re6uires the retrie al of &ust a single record! Interacti e, transaction7oriented applications need this operation Retrieve_Next : *his operation re6uires the retrie al of the record that is 8next9 in some logical se6uence to the most recently recei ed record! for example + filling in forms
*ypical Operations
Retrieve_Previous : Similar to retrie e next, "ut in this case the record that is 8pre ious9 to the currently accessed record is retrie ed Insert_One : Insert a new record into the file! It may "e necessary that the new record fit into a particular position to preser e a se6uencing of the file! Delete_One : delete an existing record! )ertain lin-ages or other data structures may need to "e updated to preser e the se6uencing of the file!
*ypical Operations
Update_One : 4etrie e a record, update one or more of its fields, and rewrite updated record "ac- into the file! Retrieve_Few : 4etrie e a num"er of records! For example, an application may wish to retrie e all records that satisfy a certain set of criteria!
Access 4ights
(one 2ser may not -now of the existence of the file 2ser is not allowed to read the user directory that includes the file :nowledge 2ser can only determine that the file exists and who its owner is
Access 4ights
,xecution *he user can load and execute a program "ut cannot copy it 4eading *he user can read the file for any purpose, including copying and execution Appending *he user can add data to the file "ut
Access 4ights
2pdating *he user can modify, deleted, and add to the file1s data! *his includes creating the file, rewriting it, and remo ing all or part of the data )hanging protection 2ser can change access rights granted to other users Deletion 2ser can delete the file
Allocation Methods
contiguous file allocation chained allocation indexed allocation
File Organization
File Organization refers to the logical structuring of the records as determined "y the way in which they are accessed )riteria for File Organization + Short access time ,ase of update ,conomy of storage Simple maintenance 4elia"ility
File Organization
Fi e different types of File Organization a aila"le+ / *he pile / *he Se6uential file / *he Indexed Se6uential file / *he Indexed file / *he Direct or hashed file
File Organization
The Pile Data are collected in the order they arri e Purpose is to accumulate a mass of data and sa e it 4ecords may ha e different fields (o structure 4ecord access is "y exhausti e search
File Organization
File Organization
The Sequential File Fixed format used for records 4ecords are the same length All fields the same %order and length' Field names and lengths are attri"utes of the file One field is the -ey filed %Primary -ey'
File Organization
The Sequential File (ew records are placed in a log file or transaction file 3atch update is performed to merge the log file with the master file!
File Organization
Sequential File
)ontains -ey field and a pointer to the main file Search continues in the main file at the location indicated "y the pointer
File Organization
Indexed Sequential File (ew records are added to an o erflow file 4ecord in main file that precedes it is updated to contain a pointer to the new record *he o erflow is merged with the main file Multiple indexes for the same -ey field can "e set up to increase efficiency
File Organization
File Organization
Indexed File
2ses multiple indexes for different -ey fields May contain an exhausti e index that contains one entry for e ery record in the main file May contain a partial index
File Organization
File Organization
The Direct or Hashed File
Directly access a "loc- at a -nown address :ey field re6uired for each record
File Sharing
In multiuser system, allow files to "e shared among users *wo issues Access rights Management of simultaneous access
*han-s