Thursday, February 22, 2007

File System 1

Files Files , and files .....
The basic abstracted unit of storage , used by the operating system to store information into non-voletile devices .

including name , identifires , type ,type size , ...etc
including :creating a file , writing a file , or even reading it . seeking though the file . deleting it .

when a file is opened its added to the open file table , and removed from there when it's closed .
different proccesse's my try to open a file at the same time , thats why some operating systems provide some a lock for file's or section of files . ther is 2 types of lock:
shared lock: where several processes can acquire the lock together .(reader lock)
exclusive lock:only one process can acquire this lock at a time . (writer's lock)

not all operating systems provided both types.
for mandatory locks , operating system ensures locking integrity .
for advisory locking, the software developer must ensure the appropriate locking .

alot of types . extenstions in the file names are considered hints for OS as to which programs uses them .

INternal File Structure:
reading and worting into physical memory is done only by blocks , i.e physical blocks , the logical blocks usually dont have the same size as the physical ones. thats why we get internal fragmentations , as almost all the time the size of the last block doesnt match the size of the last chunk of the file .

Access Methods:

1. Sequential Access:
simplest method ,as information in the file is proceess sequentially , and the pointer advance's as we go forward . (based on a tape model)
2.Direct Access:
based on the fact that a file is made up of fixed length logical records . which allow programs to read and write records rapidly in no particular order . ( based on a desk model of a file) . Databses are usally of thos type .