0% found this document useful (0 votes)
111 views41 pages

File Chhavi Organizer

The document discusses a file system organizer project that was developed using Node.js to organize files in a computer system by type and facilitate efficient searching. The project aims to simplify complex file structures through intuitive commands and automate file categorization. The document outlines the objectives, problems addressed, commands used, and technologies implemented in the project.

Uploaded by

sam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views41 pages

File Chhavi Organizer

The document discusses a file system organizer project that was developed using Node.js to organize files in a computer system by type and facilitate efficient searching. The project aims to simplify complex file structures through intuitive commands and automate file categorization. The document outlines the objectives, problems addressed, commands used, and technologies implemented in the project.

Uploaded by

sam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

FILE SYSTEM OEGANIZER

PROJECT REPORT

Dr. A.P.J Abdul kalam Technical University Lucknow


Submitted for the Fulfillment of the Requirement
For the Degree OF MASTER OF COMPUTER APPLICATION

Submitted BY Under the Guidance of


Chhavi kumari Mrs. INA KAPOOR
MCA (Sem III) Assistant Professor (MCA)
Roll No-2200590140033

Lal Bahadur Shastri Institute of Management &Development studies


Kursi Road, Lucknow 226021

Session 2023-24
ABSTRACT
The project entitled FILE SYSTEM ORGANIZER is the command
line tool developed in Node.js to create software for properly
organizing the files in the computer system. This software
tool provides the facility to manipulate all the system files
and help to store them in a proper format. So, the user can
locate and retrieve the required files efficiently. File System
Organizer is efficient, time-saving, and easy to handle for the
user. In this FSO tool, we have organized large amounts of
data in the proper manner of better management and
retrieving facility in the system. It consists of various features
like Organizing the data and viewing the tree structure of the
directory, and also the user can use customized organizing
functions (customized organizing means- organizing specific
types of files in a folder). By using FILE SYSTEM ORGANIZER
users can organize all files properly and also view the tree
structure of the directory for finding a specific file location in
the various folders. Therefore, we designed a software called
File System Organizer which will properly organize the
unsorted data. For providing this software to the user we
built our website as well. So, using our tool users can properly
handle a large amount of data.
Content
Introduction
Key Objective
Problem Statement and Solution
Commands and it’s Usage
Unique Features
Technologies Used
Hardware and Software Requirement
Results and Outputs
Conclusions
Future Scope
References
INTRODUCTION
The project aims to streamline and enhance the management
of digital files and folders. Using advanced algorithms and an
intuitive interface, our file system organizer provides users
with a powerful tool to effortlessly organize their digital
spaces. Benefits of using our file system organizer include
time savings through automated file categorization and
improved organization through a visual representation of
directory structures.
Nowadays we are involved with lots of data. Data can be
handled by a file system or database. The file system is used
for a small amount of data like maintaining the record of
class, maintaining 100 employee data, etc. But a database is
used to maintain a large amount of data. For example,
maintaining the data of the company's employees, colleges,
schools, etc. If we are using a file system and maintaining
different types of data like documents, photos, excel files, and
doc files. File system organizer it's a command line tool built
in the node in the module. The main objective of this tool is
to organize files according to their extension. This tool will
help us to arrange any unorganized folder. File system
organizers can be used widely in banking, school, University,
and many file handling system. Tree structure or hierarchical
pattern can be viewed using by file system organizer. File
systems use metadata to store and retrieve files. Examples of
metadata tags include:

 Date created
 Date modified
 Last date of access
 Last backup
 User ID of the file creator
 Access permissions
 File size
File-System-Organizer
a global command line application using Node.js. It organizes
all your files from from a folder into different section so that
you need not to do it manually.
1->This Is for help in this project.
2->Purpose of this project are:
i->I am going to start project as File System Organizer.
ii->Output of this project is to handling the large size folder.
iii->If we have lot of files in a particular folder then it will
arrange them.
iv->The files in thier extensions category such that image will
arrange in Document(jpg),mp4,mp3 file will be in media and
so on.
v->Use file System(fs) and path module.
3->First make the js file for help,Organise and tree.

4->tree.js
-In this we are going to show the files and folders by using a
particular format as tree.
5->organise.js

-In this we are going to organise the folders with their


respective file extensions as media, document, archives and
app.
6->help.js

-This is for helping purpose.


7->After this make another js file and import the help,tree
and Organise into this FO.

How to organize files and folders on your


computer.
Browsing through folders should be an intuitive process.
Continuing with our lawyer example, let's say you need to
find out when your client paid their retainer. The obvious
folder to look in would be Client invoices—not Client comms.
If you find yourself doing mental gymnastics to figure out
where you stored something, update your organization
system with these file management tips.
1. Establish a clear hierarchical folder structure
Start organizing your files by creating a logical, hierarchical
folder structure. The best folder structure will mimic
the way you work.
2. Use a consistent naming convention
Give your folders and files specific, logical names—and be
consistent. The goal is to use names that clearly indicate
what's inside without having to open it. While there's no one-
size-fits-all approach to naming conventions, here are some
tips to keep in mind.

File organizer functions


The file organizer functions allow you to create folders based
on information contained inside the file and outside the file
system it is stored in, and move / copy the file
to these folders.
ABOUT PROJECT
Earlier, we used to create the folder by clicking on the
drag-drop option, then we used to select the file and
send in that current folder which is very tedious task
and time taking task.to improve the efficiency and
reduce the time taking process, we are making this
extension. The project is about the creating of the
folders on the types of the multimedia in your Root
Folder. and cut and paste in your typed folder which
helps in the organizing your Root folder. web services
or web applications accessed via web browser over a
network connection and is developed using the
browser-supported language as the (java
script,node.js). node.js, as it supports cross platforms,
designed to display the web page on the web browser.
The ability to create, read, update, delete items in a
web application is crucial to most applications. The
basic criteria for making the CRUD operations is to
focus on the better time performance. (Or in terms of
coding we can say that it will take the constant time
complexity).
KEY OBJECTIVE
To facilitate file creation and its updating in
the future.
To provide an efficient method to locate
records needed for processing
Provide a seamless command-line interface
for efficient file organization.
Simplify complex file structures with intuitive
commands.
Automate the categorization of files based on
their types.
Problem Statement
Many users struggle with cluttered digital spaces and
unorganized files, leading to productivity issues.
If you have a lot of files in a folder and they are not
properly arranged, you can use this tool to arrange them in
a directory according to their extension, so in the end, you
will get organized files in a folder.
 In today’s world we are dealing with a large amount of
data. So, it is necessary to manage and arrange it properly
in the system
.  As data is unorganized, it would be a bad representation
of data. Unorganized data takes more time to search in a
system
.  Another thing is that if we have to find a specific file in
the directory of the system then it will be a very difficult
task
 From the unorganized data, getting a particular type of
document (For example Media, documents, apps, games,
etc.
Commands and It’s Usage
Tree Command
● Display file and folder structure.
● Syntax: node main.js tree "directory Path"
● Example: node main.js tree "/home/user/documents"
Organise Command
● Organize different types of files into respective folders .
● Steps: ○ Create folders: Video, Images, Archive,
Documents ○ Put files based on their extensions.
● Example: node main.js organise "directoryPath"
Help Command
● It display the list of available commands.
● Example: node main.js help
PURPOSE
 The main purpose of the file system organizer is to
organize, store, and accesses electronic file
efficiently.
 For achieving a good management system, it is
important to have all data files properly in the
system.
 Good file management enables the user to easily
locate the files and retrieve them ensuring all
security measures.
 File organizers allow users to take full control over
the most valuable digital data by creating digital
logical folders and subfolders for easy access when
needed.
 Without a file organisation, data would not be
divided into separate files and be challenging to
locate and recover.
 The main aim or focus of our project is to ease the life of
the user by giving the major roles or job in one interface
only. To help the user that if he wanted to download a
file, it will go in the specific folder only.
Technologies Used
● JavaScript
● Node.js
● Command-Line Interface (CLI)
● File System Module
JavaScript

JavaScript (JS) is the top programming language for web


development, used for both Client-Side and Server-Side
purposes. It’s is also known as a scripting language for web
pages. It is commonly used to create dynamic and interactive
content on websites. JS plays a crucial role in modern web
browsers, enabling client-side scripting to modify web page
content in real-time, enhancing user experience.

Why JavaScript Matters: Key Reasons to Learn


JavaScript is the most popular and hence the most loved
language around the globe. Apart from this, there are
abundant reasons to become the most demanding. Here’s
why:
• Used both Client and Server Side: Earlier JavaScript was
used to build client-side applications only, but with the
evolution of its frameworks namely Node.js and Express.js, it
is now widely used for building server-side applications too.
• Helps to build a complete solution: As we saw, JavaScript
is widely used in both client and server-side applications,
therefore it helps us to build an end-to-end solution to a
given problem.
• Used everywhere: JavaScript is so loved because it can
be used anywhere. It can be used to develop websites, games
or mobile apps, etc.
• JavaScript is constantly evolving with new features and
standards.
• Huge community support: JavaScript has a huge
community of users and mentors who love this language and
take it’s legacy forward.

Features of JavaScript
There are following features of JavaScript:
1. All popular web browsers support JavaScript as they
provide built-in execution environments.
2. JavaScript follows the syntax and structure of the C
programming language. Thus, it is a structured
programming language.
3. JavaScript is a weakly typed language, where certain
types are implicitly cast (depending on the operation).
4. JavaScript is an object-oriented programming language
that uses prototypes rather than using classes for
inheritance.
5. It is a light-weighted and interpreted language.
6. It is a case-sensitive language.
7. JavaScript is supportable in several operating systems
including, Windows, macOS, etc.
8. It provides good control to the users over the web
browsers.

Application of JavaScript
JavaScript is used to create interactive websites. It is mainly
used for:
o Client-side validation,
o Dynamic drop-down menus,
o Displaying date and time,
o Displaying pop-up windows and dialog boxes (like an
alert dialog box, confirm dialog box and prompt dialog
box),
o Displaying clocks etc.

Node.js
Node.js is a cross-platform runtime environment and library
for running JavaScript applications outside the browser.
It’s primarily used for creating server-side and networking
web applications. Here are some key points about Node.js.
1. Cross-Platform: Node.js works across different
operating systems, making it versatile for developers.
2. JavaScript Runtime: It’s built on Google Chrome’s V8
JavaScript Engine, which ensures fast code execution.
3. Asynchronous and Event-Driven: Node.js APIs are
non-blocking, allowing servers to handle multiple
requests efficiently.
4. Single-Threaded with Event Loop: Node.js follows a
single-threaded model with an event loop, which aids
scalability.
5. Highly Scalable: The event mechanism enables non-
blocking responses, making Node.js suitable for handling
large numbers of concurrent connections.
6. No Buffering: Node.js processes data in chunks,
avoiding buffering during file uploads.
7. Open Source: Node.js has a vibrant open-source
community, offering various modules to enhance its
capabilities.
Key Features of Node.js:
1. Speed: Thanks to the V8 engine, Node.js executes code
swiftly.
2. Asynchronous I/O: APIs are non-blocking, ensuring
efficient handling of requests.
3. Single Thread: Node.js uses a single thread with an
event loop, making it lightweight.
4. Scalability: Event-driven architecture allows for easy
scaling.
5. No Buffering: Node.js doesn’t buffer data during
uploads.
6. Open Source: It’s freely available and supported by a
thriving community.

Unique Features
● Tree visualization for directory structure understanding.
● Automated organization into folders based on file types.
File organization refers to the way data is stored in a
file. File organization is very important because
it determines the methods of access, efficiency, flexibility
and storage device to use.
Efficiently organizes files based on their extensions into
appropriate directories.
Simplifies the process of arranging files for better file
management.
Improves the overall organization and accessibility of
your files.
How to Use Tree
To view the tree structure of the files:

node main.js tree


Organize
To organize all files into their respective directories
based on their file extensions:
node main.js organize "path"
Help
To display all available commands:
node main.js help
How to Use Globally
Add the Shebang syntax at the beginning of the main.js
file: #!/usr/bin/env node
Initialize your project:
npm init -y
"fs": "main.js"
}

Link the tool to make it globally accessible:


npm link
Now you can use the tool globally:
fs tree "path"
fs organize "path"
fs help
Note: File System Organizer simplifies the process of file
organization, making it easier to manage and access
your files efficiently.

Hardware and Software


Requirements
Hardware Requirements
● Processor: Intel Core i3
● RAM: 4 GB or higher
● Storage: Minimum 10 GB of free disk space
● Display: 1024x768 resolution or higher

Software Requirements
● Operating System: Windows 10
● Node.js: Version 12.x or later
● npm (Node Package Manager): Version 6.x or later
● Internet Connection: Required for installation and updates

Flow chart
Result and Output
Run help command: node main.js help
 After implementing the file organizer tool unorganized
folder is converted to a properly organized folder.

ADVANTAGES
 This tool is useful in various organizations/ institutes to
arrange all types of files to be organized efficiently.
 This is also a very user-friendly interface for the user.
 File system organizer can bring an organization’s
documents together in one place for easy accessibility.

Improved efficiency : A well-organized file


system can help you access and retrieve files more quickly
and easily, as you can use logical file names and directory
structures to find files. This can save time and improve your
productivity.

Better collaboration : A clear and organized file


structure can make it easier for multiple people to access
and collaborate on files, as everyone can easily understand
the layout of the file system and find the files they need.

FUTURE SCOPE
The future of file system is likely continued
advancements Is performance, security and
scalability. Technologies such as distributed file
systems, cloud storage, an improvements in data
organization and access are expected to play a
significant role. Additionally, developments in
file system management, data integrity, and
integration with emerging Technologies. As
technology continues to evolve, file systems are
likely to adapt to meet the increasing demands
of data storage, processing and management.

Source Code
Main.js
inputArray = process.argv.slice(2)
let fs = require("fs")
let path = require("path")
// node main.js tree "directory Path"
// node main.js organise "directory Path"
// node main.js help "directory Path"
let types = {
media : ["mp4","mkv","mp3"],
archives: ['zip','7z','rar','tar','ar','iso','xz'],
documents:
['docx','doc','pdf','xlsx','xls','odt','ods','odp','odg','odf','txt','ps
','tex'],
app:['exe','dmg','pkg','deb'],
image:['jpg','jpeg','png']
}
let command = input Array[0]
switch(command){
case "tree":
treeFn(input Array[1])
break
case "organise":
organiseFn(input Array[1])
break
case "help":

helpFn()

break
default:
console.log("Please Enter valid command");
}

function treeFn(directoryPath){
if(directoryPath == undefined){
console.log("Kindly Enter the path");
return
}
let destPath;
let doesExist = fs.existsSync(directoryPath)
if(doesExist){
treeHelper(directoryPath)
}else{
console.log("Kindly Enter the correct path");
return
}
}
function treeHelper(directoryPath){

}
function organiseFn(directoryPath){
// console.log("Orgabise command
implemented",directoryPath);
// 1. input ---> directoryPath given
if(directoryPath == undefined){
console.log("Kindly Enter the path");
return
}
let destPath;
let doesExist = fs.existsSync(directoryPath)
if(doesExist){
// 2. create --> organisedFile --> directory
destPath = path.join(directoryPath,"organised_file")
if(fs.existsSync(destPath) == false){
fs.mkdirSync(destPath);
}
}else{
console.log("Kindly Enter the correct path");
}
organiseHelper(directoryPath,destPath);
// 3. identify category of all the files present in that input
directory ->
// 4. copy/cut files to that organised directory inside of
any of category folder
}
function organiseHelper(src,destPath){
let filesName = fs.readdirSync(src)
// console.log(filesName);
for(let i=0; i<filesName.length; i++){
let fileAddress = path.join(src,filesName[i])
let isFile = fs.lstatSync(fileAddress).isFile();
if(isFile){
// console.log(filesName[i]);
let category = getCategory(filesName[i])
console.log(filesName[i], "belongs to ----> ",
category);
//4. copy/cut files to that organised directory inside
of any of category folder
sendFiles(fileAddress,destPath,category);
}
}
}
function sendFiles(srcFilePath,destPath,category){
let categoryPath = path.join(destPath,category)
if(fs.existsSync(categoryPath)==false){
fs.mkdirSync(categoryPath);
}
let fileName = path.basename(srcFilePath);
let destFilePath = path.join(categoryPath,fileName);
fs.copyFileSync(srcFilePath,destFilePath);
fs.unlinkSync(srcFilePath)
console.log(fileName, "copied to ",category);
}
function getCategory(fileName){
let ext = path.extname(fileName)
ext = ext.slice(1)
for(let type in types){
let cTypeArray = types[type];
for(let i=0;i<cTypeArray.length;i++){
if(ext == cTypeArray[i]){
return type;
}
}
}
return "others";
}

function helpFn(){
console.log(`
List of command:
node main.js tree "directoryPath"
node main.js organise "directoryPath"
node main.js help
`);
}
function treeFn(dirPath) {
// let destPath;
if (dirPath == undefined) {

treeHelper(process.cwd(), "");
return;
} else {
let doesExist = fs.existsSync(dirPath);
if (doesExist) {
treeHelper(dirPath, "");
} else {

console.log("Kindly enter the correct path");


return;
}
}
}

function treeHelper(dirPath, indent) {


// is file or folder
let isFile = fs.lstatSync(dirPath).isFile();
if (isFile == true) {
let fileName = path.basename(dirPath);
console.log(indent + "├──" + fileName);
} else {
let dirName = path.basename(dirPath)
console.log(indent + "└──" + dirName);
let childrens = fs.readdirSync(dirPath);
for (let i = 0; i < childrens.length; i++) {
let childPath = path.join(dirPath, childrens[i]);
treeHelper(childPath, indent + "\t");
}
}
}
module.exports = {
treeKey: treeFn
}

CONCLUSION
The File System Organizer organized all the unsorted data
in our computer system. This saves a lot of time rather to
when we organized manually. The main aim of this project
is to automatically make a separate folder for each domain
within the root directory, which help our time efficient that
increase our performance. It helps to sort the folders for
every particular domain.it is optimized for the majority
processing.it helps to the mobility, flexibility, reduced
burden on the keeping a tough copy helps to avoid wasting
the memory as delicacy is minimized between the
folders.it also gives the fast access to the specific
document, and also, we are able to retrieve the document
anytime and anywhere.

The file is actually the


collection of associated
information. This file-system
prearranged into
directory for efficient usage.
Every directory has a number
of files and other directories.
The directory is defined as a
bit which distinguish the
entries that explained file
and subdirectories in the
recent directory. By
theoretically we
may change the file into a
directory by changing its bit. A
file system is considered as an
element of an operating-
system that manage the storage
space and operation of files on
media like disks.
References :-
https://www.geeksforgeeks.org
https://www.youtube.com
https://github.com
https://www.w3schools.com
https://www.javatpoint.com
https://nodejs.org

You might also like