Complete Computer Knowledge Portal

Saturday, May 4, 2013

Directory Implementation

Directory efficiency, performance and reliability are totally dependent on the technique used to store them. They are saved on Disks with two well Known Techniques:

1) Linear List: It is the Simple method of directory implementation. It makes use of a file name and a pointer to data blocks. Whenever a new file is created, whole directory is checked to make sure that no existing file has the same name. If the directory contains no file with this name it is added to the end of directory. For the deletion operation file is searched and the allocated space is released.

The Main Disadvantage is of this technique is that every time we create a new file, directory has to be checked for existing file name .The second problem is that files are accessed in a serial fashion which results in slow performance 

2) Hash Tables: In technique Directories are saved in same linear fashion but a hash table is used. It takes a value that is returned from file name and returns a pointer to file name. This technique decreases the search time for files.

Disadvantage of using this technique is fixed size of Hash Tables. E.g. if we have hash table which can store 32 entries and we want to add 33th entry to it, then it is required to be extended. This new extended Hash Table will have 64 entry capacity( 2 X32).As the size of Hash Table increases we also need a Hash Table function that can reference range of 0 to 64 entries.

No comments:

Post a Comment