Starting from:

$30

UCS1411-Lab 12 File Organization Techniques Solved

AIM:

To develop a C program to implement the following file organization techniques 

a)     Single level Directory

b)    Two level Directory

c)     Hierarchical Structure

d)    DAG

Procedure:

1.     Single Level Directory

a.     Maintain a table containing the filename and the starting address location of that file.

b.     Give options for creating a new file.

c.     When creating the file, check for name collision.

d.     Update the table accordingly.

2.     Two level Directory

a.     Maintain tables for MFD and UFD.

b.     Each MFD entry is a directory which in turn has entries for files.

c.     Give options for creating a directory, creating a file and searching for a file.

d.     Update the respective tables accordingly.

3.     Tree Structured Directory

a.     Maintain tables for each directory starting from root. 

b.     Limit each directory to have a maximum of five sub-directories and files.

c.     For each sub-directory follow the same table structure as described above.

4.     DAG

a.     Data structure is same as tree structured directory but can create a link to an existing file.

b.     Give options for creating a directory, file and also links.

 

SAMPLE INPUT & OUTPUT:

 

File Organization techniques

 

1.Single Level Directory

2.Two Level Directory

3. Tree structures directory

4.DAG

 

Enter your option: 1

 

1.Create a file

2.List the files

 

Enter your option:1

 

Enter the name of the file: file1 File created!

 

1.Create a file

2.List the files

 

Enter your option:1

 

Enter the name of the file: file2

 

File created!

 

1.Create a file

2.List the files

 

Enter your option:1

 

Enter the name of the file: file2 File already exists!

 

Enter your option:2

  Contents of root directory

 

 

                     File Name    Location

 

                     *****           ***      

 

                     *****           ***     

 

                        •

 

                        •

 

 Similarly for all other structures

More products