CS1411 Lab Exercise 13 File Organization Techniques solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

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

a) Single level Directory
b) Hierarchical Structure

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. Tree Structured Directory
a. Maintain tables for each directory starting from root.
b. Create a structure for a node in tree which contains an array to hold directories
and an array to hold files.
c. Limit each directory to have a maximum of three sub-directories and files.
d. For each sub-directory follow the same table structure as described above.

SAMPLE INPUT & OUTPUT:
File Organization techniques
1.Single Level Directory
2. Tree structures directory
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
file1 1000
file2 3500


• Similarly for all other structures