OS HOBBY (1) - Merged
OS HOBBY (1) - Merged
2024-2025
CMR ENGINEERING COLLEGE
UGC AUTONOMOUS
(Approved by AICTE, Affiliated to JNTU, Kukatpally,
Hyderabad) Kandlakoya, Medchal Road, Hyderabad-501401.
DEPARTMENT OF CSE(AI & ML)
CERTIFICATE
This is to certify that a Lab project entitled with: “BASIC FILE COMPRESSION TOOL”
CSE(AI & ML),CMREC for their inspiration and valuable guidance during entire duration.
ML) department for his constant guidance,encouragement and moral support throughout the
project. We express our thanks to all staff members and friends for all the help and
(238R1A6653)
ABSTRACT
File compression is a fundamental feature in modern operating systems that optimizes storage space
and enhances data transfer efficiency. A basic file compression tool employs algorithms to reduce
file sizes by eliminating redundancies, encoding data efficiently, and often utilizing lossless
compression techniques to preserve original content integrity. Such tools are critical for managing
limited storage resources, streamlining file sharing, and improving system performance. This paper
introduces a basic file compression tool, discussing its architecture, algorithms (e.g., Huffman
coding or LZW), and integration into operating systems. It highlights the tool’s utility in balancing
speed and compression ratio, ensuring user-friendly operation while maintaining compatibility with
various file formats. This approach aims to provide a practical solution for everyday compression
needs in diverse computing environments.
INTRODUCTION
Operating systems incorporate compression tools to empower users with straightforward methods
to manage large files and directories without external software dependencies. These tools are
particularly valuable in scenarios with limited storage resources or bandwidth constraints, where
every byte saved can make a significant difference.
This paper presents a basic file compression tool designed for operating systems, focusing on its
functionality, ease of use, and algorithmic efficiency. By integrating this tool into file management
processes, users can experience streamlined storage and improved data handling capabilities. The
tool is aimed at addressing common challenges in data management, offering a simple yet effective
solution for compression needs.
The core principle of file compression lies in utilizing algorithms that reduce file size while
maintaining data integrity. Lossless compression techniques, such as Huffman coding or
Lempel-Ziv-Welch (LZW), are commonly used to ensure that the original data can be fully restored
upon decompression. This makes them suitable for system-critical files, documents, and software
applications where accuracy is paramount.
LITERATURE SURVEY
File compression has been a vital area of research and development, especially in operating systems
where efficient storage management and data transfer are critical. Over the years, various algorithms,
techniques, and tools have been proposed to optimize file compression performance. This section
provides an overview of existing studies, methodologies, and tools relevant to the development of a
basic file compression tool.
1. Compression Algorithms
2. File Compression Tools
3. Compression in Operating Systems
4. Challenges in Compression
5. Advancements in Compression
2. Analysis of Data
The tool scans the file to identify patterns, redundancies, or frequently occurring
data.
5. Decompression Support
The tool ensures that the compressed file can be decompressed to restore the
original data.
This involves reversing the compression process:
Reconstructing the original data using stored metadata and the applied algorithm.
SOURCE CODE
#include <stdio.h>
#include <stdlib.h>
#include
<string.h>
#include <zlib.h>
free(compressed_data);
free(decompressed_data);
}
int main(int argc, char *argv[]) {
if (argc != 4) {
printf("Usage: %s <compress|decompress> <input_file> <output_file>\n", argv[0]);
return 1;
}
if (strcmp(operation, "compress") == 0) {
compress_file(input_file, output_file);
} else if (strcmp(operation, "decompress") == 0)
{ decompress_file(input_file, output_file);
} else {
printf("Invalid operation. Use 'compress' or 'decompress'.\
n"); return 1; }
return 0;
}
ADVANTAGES
Quicker Uploads/Downloads: Smaller files reduce the time needed for data
transfer over networks or the internet.
Convenient Sharing: Compressed files are easier to email or share through file-sharing
platforms.
Easy Decompression: Decompression restores the original file without data loss, ensuring
accessibility.
1. Processing Overhead
Time Consumption: Compressing and decompressing large files can take considerable
time, especially on slower systems.
CPU Usage: Compression algorithms may require significant processing power, which
can slow down other operations.
Already Compressed Files: Files like videos (e.g., MP4) or images (e.g., JPEG) are already
optimized and may not compress further, resulting in negligible size reduction.
Random Data: Files with random or encrypted data cannot be compressed effectively.
Dependency Tools: Some compressed formats require specific tools or software for
decompression, leading to compatibility issues.
5.STORAGE TRADE-OFFS
Minimal gain for small files: Compressing small files may result in negligible
space savings while adding unnecessary complexity
APPLICATIONS
1.Storage Optimization
Reducing Disk Space Usage: Compressing files allows users to store more data
within the same storage capacity.
1. Data Transmission
Faster File Transfers: Smaller file sizes reduce upload/download times, optimizing
data transfer over networks.
2. Improved Performance
Speeding Up File Access: Some operating systems and applications read compressed files faster
than uncompressed files due to reduced I/O operations.
4. Multimedia Management
Image Compression: Reducing image file sizes without compromising quality for websites, apps,
or digital platforms.
5. File Sharing
Peer-to-Peer Sharing: Compression is widely used in file-sharing networks to minimize data size
and reduce transfer times.
CONCLUSION
A basic file compression tool is a vital utility in modern operating systems, offering significant
advantages in terms of storage optimization, faster data transfer, and improved performance. By
reducing file sizes, these tools help conserve valuable storage space, streamline file management,
and speed up data transmission over networks. They are widely used in various applications, from
personal file handling to enterprise-level backup and data sharing.
However, while file compression tools are beneficial, they come with certain limitations. These
include processing overhead, potential compatibility issues, and the risk of data loss or file
corruption. Additionally, some file types may not benefit from compression, and lossy
compressionmethods can lead to quality degradation in media files.
In conclusion, a basic file compression tool is a highly useful and practical tool, making it an
indispensable part of the file management process in operating systems, provided its limitations are
considered and managed effectively.
REFERENCES
•Books
•Research Papers and Articles
•Websites and Online Resources
•Online Tools and Libraries
•Tools and Libraries Documentation