File Chhavi Organizer
File Chhavi Organizer
PROJECT REPORT
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
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:
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.
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 {
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.