2. WHAT IS A FILE?
A file is a collection of records.
Data or applications can be stored in files. There are
two types of files: simple and complex. Both the
operating system and the software that creates the
file decide the structure of the file. Files are kept in
a file system, which can be found on a disc, tape, or
main memory.
File entries or attributes include file name, file type,
location, size, protection/permission, timestamp,
ownership, and directory information.
3. 1.Organization: A file system allows files to be organized into directories
and subdirectories, making it easier to manage and locate files.
2.Data protection: File systems often include features such as file and
folder permissions, backup and restore, and error detection and
correction, to protect data from loss or corruption.
3.Improved performance: A well-designed file system can improve the
performance of reading and writing data by organizing it efficiently on
disk.
The advantages of using a file system
4. WHAT IS A DIRECTORY?
A directory is a container that is
used to contain folders and files.
It organizes files and folders in a
hierarchical manner.
6. 1) Single-level
directory:
• The single-level directory is the simplest
directory structure. In it, all files are
contained in the same directory which makes
it easy to support and understand.
• Since all the files are in the same directory,
they must have a unique name. If two users
call their dataset test, then the unique name
rule violated.
7. 2) Two-level directory
In the two-level directory structure, each
user has their own user files directory
(UFD). The UFDs have similar structures,
but each lists only the files of a single
use.
The main advantage is there can be
more than two files with same name,
and would be very helpful if there are
multiple users.
8. 3) Tree Structure/ Hierarchical Structure
• Tree directory structure of operating system is
most commonly used in our personal
computers. User can create files and
subdirectories too.
• This directory structure resembles a real
tree upside down, where the root
directory is at the peak. This root contains
all the directories for each user. The users
can create subdirectories and even store
files in their directory.
9. 4) Acyclic Graph Structure
In acyclic graph directory structure,
where a file in one directory can be
accessed from multiple directories. In this
way, the files could be shared in between
the users. It is designed in a way that
multiple directories point to a particular
directory or file with the help of links.
10. 5) General-Graph Directory
Structure
When general graph directories are allowed, commands
like, search a directory and its subdirectories, must be used
with caution. If cycles are allowed, the search is infinite.
The biggest issue with this type of directory layout is
figuring out how much space the files and folders have
used up.