In this blog, we will be discussing a brief about Files and Directories in Operating Systems.
We will know what is a File First
A file is nothing but a collection of information. The information can be numbers, characters, graphs, images, etc. Every file should be stored under a unique name for its future reference. Every file should be saved along with an extension.
Then what is Directory
A directory can also be defined as a listing of related files on the disk,
In other words, a Directory is a folder that contains details about files, file size, and the time when they are created and last modified.
They are 3 types of File Directories
1. Single-level Directory
2. Two-level Directory
3. Tree-structured Directory
Single-level Directory:
All the files belong to a single directory
Advantages
- Easy to implement
- Reduced Redundancy
Disadvantages
- All files belong to the same directory
- The user can’t have 2 files with the same names
- User doesn’t have the option to group files according to his/her needs.
Two-level Directory
In this type of directory, each user has their own directory.
In the two-level directory structure, each user has his own user file directory (UFD). The UFDs have similar structures, but each lists only the files of a single user. When a user job starts or a user logs in, the system’s master file directory (MFD) is searched. The MFD is indexed by user name or account number, and each entry points to the UFD for that user.
Advantages:
- Sharing Directory by users problem is solved
- Efficiently
- More secure than 1 level directory
- Two users can have a file with the same name in their own directories.
Disadvantages
- Grouping problem is still not solved, for example, if user wants to create a directory group for all files that are movies or music., he cants do that
2.No two files for a single user can have the same names.
Due to two levels, there is a path name for every file to locate that file.
Tree-structured Directory
The directory is maintained in the form of a tree. Searching is efficient and also there is a grouping capability. We have absolute or relative path names for a file.
Advantages
- Two files can have the same names now if they are in different subdirectories.
- Grouping is also possible now.
This is a brief description of the Files and Directory.
Now we will see about Distributed Systems.
Distributed systems:
Generally, what are Distributed systems
So Generally, Distributed System is a collection of autonomous computer systems that are physically separated but are connected by a centralized computer network that is equipped with distributed system software. The autonomous computers will communicate among each system by sharing resources and files and performing the tasks assigned to them.
We will now see what are the Advantages of Distributed Systems
1. Applications in Distributed Systems are Inherently Distributed Applications.
- Information in Distributed Systems is shared among geographically distributed users.
- Resource Sharing (Autonomous systems can share resources from remote locations).
- It has a better price-performance ratio and flexibility.
- It has a shorter response time and higher throughput.
- It has higher reliability and availability against component failure.
- It has extensibility so that systems can be extended in more remote locations and also incremental growth.
While there are advantages there are also Disadvantages
The main Disadvantages of Distributed Systems are:
- Relevant Software for Distributed systems does not exist currently.
- Security possess a problem due to easy access to data as the resources are shared to multiple systems.
- Networking Saturation may cause a hurdle in data transfer i.e. if there is a lag in the network then the user will face a problem accessing data.
- In comparison to a single-user system, the database associated with distributed systems is much more complex and challenging to manage.
- If every node in a distributed system tries to send data at once, the network may become overloaded.
We also have a question about where we will be using these File Directories
Some Applications where we use Files and Directories
- In Finance and Commerce
- Information Society
- Cloud Technologies
- Entertainment
- Healthcare
- Education
- Transport and Logistics etc
In many fields and areas, we use these Files and Directories.