0% found this document useful (0 votes)
13 views

Group 3 Concepts of Files and

File management is crucial for effective organization, storage, and retrieval of digital files. It involves operations like creating, opening, reading, writing, renaming, deleting, copying and moving files, as well as organizing files into directories. Different operating systems provide system calls and APIs to perform these operations.

Uploaded by

findyandx
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Group 3 Concepts of Files and

File management is crucial for effective organization, storage, and retrieval of digital files. It involves operations like creating, opening, reading, writing, renaming, deleting, copying and moving files, as well as organizing files into directories. Different operating systems provide system calls and APIs to perform these operations.

Uploaded by

findyandx
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

GROU

P3
FILE
MANAGE
MENT
Introduction
A file system defines how files are named, stored, and retrieved from a storage device.
When you open a file on your computer or smart device, the operating system uses its
file system internally to load it from the storage device.
File systems handle tasks like copying, editing, and deleting files.
Without a file system, storage devices would be chaotic, akin to a room with scattered
papers.
Key responsibilities of a file system include:
Space Management: Allocating and managing storage space efficiently.
Metadata: Storing information about files (e.g., creation date, size, permissions).
Data Encryption: Ensuring data security.
File Access Control: Determining who can read, write, or execute files.
Data Integrity: Preventing corruption or loss of data.
● File management is an essential aspect of organizing and storing digital data
effectively.
● In this presentation, we will explore the concept of file management and discuss its
various types.
● File management is crucial for effective organization, storage, and retrieval of
digital files.
● Different types of file management systems cater to various requirements and use
cases.
● By understanding and implementing appropriate file management techniques,
businesses and individuals can optimize their data management processes.
Title: Concept of Files and Its Types
What is File Management?
● File management refers to the process of organizing, storing, and
retrieving digital files efficiently.
● It involves creating, modifying, deleting, and organizing files and
directories to ensure optimal use of storage space.
● Effective file management ensures easy access, security, and efficient
usage of files.
Benefits of File Management
● Improved organization: File management helps in organizing files in a structured manner,
making it easier to find and access them.
● Data integrity: With proper file management, data integrity is maintained, ensuring that files
are not corrupted or lost.
● Storage optimization: File management allows efficient utilization of storage space by
eliminating duplicate files and organizing data hierarchically.
● Enhanced security: File management enables the implementation of access controls and
encryption methods to protect sensitive data.
● Backup and recovery: Proper file management facilitates regular backups and simplifies
the process of recovering lost or corrupted files.
Types of File Management
1. Sequential File Management:
2. Hierarchical File Management:
3. Indexed File Management:
4. Relational File Management:
1.Sequential File Management:
● Files are stored in a sequential manner, one after the other.
● Accessing a specific file requires reading through all the preceding files.
● Suitable for situations where files are processed in the order they were created, such as log
files.

2.Hierarchical File Management:


● Files are organized in a hierarchical tree-like structure, with a root directory and multiple
subdirectories.
● Allows for logical grouping and categorization of files.
● Provides a clear path for locating files and folders.
● Commonly used in operating systems like MS-DOS.
3. Indexed File Management:
● Uses an index to store file locations and attributes, enabling fast file access.
● The index contains key-value pairs, where the key is typically based on file attributes
like name or type.
● Facilitates quick searching and retrieval of files.
● Commonly used in databases and file systems like NTFS (New Technology File
System).

4. Relational File Management:


● Stores files as a collection of related records.
● Each record contains multiple fields or attributes.
● Allows for complex queries and relational operations.
● Widely used in database management systems like MySQL and Oracle.
File operations within an operating system (OS) encompass a set of essential tasks and actions directed at files and
directories residing within a computer’s file system. These operations are fundamental for the effective management
and manipulation of data stored on various storage devices. In this article, we will learn different file operations and
what are the system calls and APIs used to perform them in a Linux / Windows-based OS.
File Creation and Manipulation
File Creation and Manipulation encompasses essential operations within an operating system that
involve creating, modifying, and organizing files and directories. These actions are vital for managing
data efficiently and are integral to the functioning of computer systems.
File Operation Description System Calls / APIs
• open() (Linux-like systems)
Creating Files Create a new file for data storage.
• CreateFile() (Windows)

Create a new directory for organizing • mkdir() (Linux systems)


Creating Directories
files. • CreateDirectory() (Windows)

Open a file that you already have open to • open() (Linux systems)
Opening Files
read or write from. • CreateFile() (Windows)

• read() (Linux systems)


Reading Files Retrieve data from an open file.
• ReadFile() (Windows)

• write() (Linux systems)


Writing Files Store data in an open file.
• WriteFile() (Windows)

• rename() (Linux systems)


Renaming Files and Directories If you want to rename a file or directory,.
• MoveFile() (Windows)

• unlink() (Linux systems)


• remove() (Linux systems)
Deleting Files and Directories Remove files or directories.
• DeleteFile() (Windows)
• RemoveDirectory() (Windows)
File Organization and Search
File organization and search are key OS operations for
arranging files systematically and swiftly locating specific
data, optimizing file management and user efficiency.

File Operation Description System Calls / APIs


Create duplicates of files in another • cp (Linux systems)
Copying Files
location. • CopyFile() (Windows)

Relocate files from one location to • mv (Linux systems)


Moving Files
another. • MoveFile() (Windows)

• find (Linux systems)


Searching for Files Locate files based on specific criteria. • FindFirstFile() and FindNextFile()
(Windows)
File Security and Metadata
File Security and Metadata are vital components of file
management, encompassing access control and crucial file
information preservation within an operating system. They are
essential for data security and efficient organization.

File Operation Description System Calls / APIs


Control access rights to files and • chmod (Linux systems)
File Permissions
directories. • SetFileSecurity (Windows)

Assign specific users or groups as file • chown (Linux systems)


File Ownership
owners. • SetFileSecurity (Windows)

Retrieve and manipulate file • stat (Linux systems)


File Metadata
information. • GetFileAttributesEx (Windows)
File Compression and Encryption
File Compression and Encryption are essential for optimizing
storage and enhancing data security. Compression reduces
file sizes, while encryption safeguards data privacy by making
it unreadable without the correct decryption key.

File Operation Description System Calls / APIs


Reduce file sizes to save storage • gzip, zip, tar (Linux systems),
File Compression
space. • Compress-Archive (Windows)

• openssl, gpg (Linux systems)


Protect data by converting it into an • Windows provides encryption
File Encryption
unreadable format. libraries and APIs for encryption
operations.
ACCESS METHODS
Sequential Access Method

The sequential access method has three operations:


It is one of the simplest access methods and is widely
used in editors and compilers. You must have seen the
audio cassettes. Even they use the same access  Read next: It will read the next record in the file.
method. The file pointer (current pointer) will advance to
The files are a collection of records. Accessing the file the next record. It is similar to how we traverse
is equivalent to accessing the records. In the sequential the nodes in a linked list.
access method, each record is accessed sequentially,
one after the other. Consider the below image for more  Write next: This operation is used when some
clarity. more information is to be included in the file. A
new node (a record) will be added at the end of
the file. The end pointer will now point to the
node that has been added, marking it as the
new end of the file. It is similar to adding a new
node at the end of a linked list.

• Rewind: This will bring the read and write


pointers to the beginning of the file.
Direct Access Method

In the direct access method, the files are considered as • The direct access method has the following
a sequence of blocks or records, just like the disk was operations:
considered to be divided into equal-sized blocks. The
benefit of this method is that we can access any block  Read n: This operation is used to read the nth
randomly. The direct access method is known as the block. Read 6 would allow us to read block B6.
relative access method. The exact block address is
known only to the operating system. When a user wants  Write n: This operation is used to write in the
to access a particular block, he/she provides the relative nth block.
block number, which the operating system then uses to
find the exact block address. • Goto n: This operation is used to directly access
the nth block.
This type of access method is used in database
management systems.
Index Sequential Access/ Index Access

• The major issue with the sequential access method was that it did not allow random
access to the file records/blocks. The index sequential access method solves this
problem. In this method, there is an index that holds the pointers to various blocks of
the file. In order to access any block of the file, one has to first access the index,
and from there, we can get the pointers to various blocks.

• This method is very similar to the indexed file allocation method, where we had an
index block that held pointers to various other disk blocks that were allocated to the
file.
Sequential Access Direct Access Index Access

• It is very simple to • Faster than the sequential • It is a modification of the


implement. The work is access method. sequential access method.
similar to a linked list. • Allows random access. It allows random access.
• Since the records cannot Therefore there is no need • Apart from the file records,
be randomly accessed, it is to traverse all the blocks. an extra index is required to
not a very efficient method. • Implementation is easy. keep track of the blocks.
• It is a slow method. • In case file size increases,
the index may not be able
to hold all the pointers due
to memory constraints.
Hence in such a case multi-
level index may be used.
ADVANTAGES

Sequential Access Direct Access

Simple and easy to implement, requiring minimal Random access to specific data within a file allows for
hardware and software support. quick and efficient data retrieval.
Low cost, as it doesn't require complex indexing or High concurrency, enabling multiple processes to
search algorithms. access the same file simultaneously and efficiently
Highly efficient for dealing with large data sets, as share data.
data is stored in a linear fashion and can be accessed Flexible data retrieval, suitable for accessing data in a
non-sequential fashion.
in a predictable manner.
Suitable for applications that require processing of Efficient data modification, as changes to specific
data in the order it was written, such as backup data can be made without rewriting the entire file.
systems or data archival.
Suitable for real-time systems that require fast and
predictable data access.
is not efficient for randomly accessing data within a Access Method can be inefficient when you need to
file, as it requires searching through the entire file to retrieve small pieces of data frequently. This is
find the desired data. because the method is optimized for accessing
larger chunks of data, so it might not work efficiently
Limited concurrency: Concurrent access to a for tiny bits of information.
sequential file can be challenging, as only one
process can access the file at a time. Space Management Challenges: Managing the
available space using the Direct Access Method can
Inflexible data retrieval: Since data must be be complex. It's like arranging things in a box – if
retrieved in the order it was stored, sequential you're not careful, things can get disorganized and
access can be inflexible for applications that require jumbled up. This can lead to wasted space and
accessing data in a non-linear fashion. difficulties in keeping track of where data is stored.
DISADVANTAGES

Limited real-time access: Sequential access is not Fragmentation Issues: Fragmentation can happen
suitable for real-time systems, as data retrieval time when there are gaps between stored data blocks.
can be unpredictable These gaps can result from adding, updating, or
deleting records. Like a jigsaw puzzle with missing
pieces, fragmentation makes it less efficient to use
the available space.

Varied Record Lengths: The Direct Access Method


might not work well when dealing with records of
different lengths. Imagine trying to fit objects of
different sizes into fixed compartments – it can be
challenging and lead to inefficiencies in storage and
retrieval.
More Methods
● Relative Record Access
● Content Addressable Access
● Hierarchical Access Method
● Network File System (NFS)

You might also like