Feature #6: File Management System
Implement the "File Management System" feature for our "Operating System" project.
We'll cover the following
In this feature, we will make a file management system that will maintain a file system index. We want to allow the user to conduct searches with an optional wildcard character,
., which matches any single character. For example,
. in the string
.ata can have 26 possible search results like
cata, and so on. We must keep in mind while searching that if the searched word matches some part of an already added file or directory then it should return
For this feature, the target is to have a data structure that will:
- Add a file or directory name in the data structure. A file or directory name can be added only once. It must not allow two files with the same name. Keep in mind that file and directory names are case-sensitive.
- Perform wildcard searches. The search should return
falseif the word is not found in the file system. Otherwise, the search should return
- Return a list of all the files and directories in the data structure.
Let’s take a look at how we can add, search, and get all the files and directory names with the help of the following example: