Skip to content

KomeOn/Simple-File-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Simple-File-System

Designed a simple File System having defined constraints using C++.
Implemented multiple functions such as create a file, list all files, delete the file, read and write the file.

Input

  • Input is taken through Console.

    • Input includes the following commands:
    • "Make file": mf filename filecontents

    • "Delete file": df filename

    • "Rename file": rf filename1 filename2

    • "Print file": pf filename

    • "List file": ls

      Note: 
          *  No space contained words can be used for file name .i.e, 
                ex: mf file name "Hello worlds"   ====> Not supported
                ex: mf filename "Hello worlds"    ====> Supported
      

Commands

  • mf file-name filecontents

    • first check for the uniqueness of the filename
    • create a unique inode for file
    • insert filename and corresponding inode into the meta data.
    • insert the inode and filename into the sets for checking the uniqueness further.
    • calculate the number of disk files required and create disk block files with inodeno_blockno
  • df file-name

    • check if the file with given name is present in the file system
    • get the inode of the file to be deleted
    • remove the file entry from the meta data
    • retrieve the number of disk files created for the file to be deleted
    • remove the disk block entry from the file
    • delete all the disk files.
    • remove the file from the list of files
    • remove the inode from the inode list.
  • rf file-name1 file-name2

    • check whether the new filename is unique
    • check if the file with given name is present in the file system
    • rename the filename in the metadata
    • remove the file from the list of files
    • insert the new filename into the list of files
  • pf file-name

    • check if the file with given name is present in the file system
    • get the inode of the file to be displayed
    • retrieve the number of disk files created for the file to be displayed
    • display all the disk file contents
  • ls

    • list all the files from the meta_data

How to run

  1. Download the repository in your local machine.
  2. Open terminal and run command "make", it will create an executable file of the code.

Screenshots

"mf" command

Screenshot from 2022-09-17 12-14-17

"df" command

imgonline-com-ua-twotoone-Iv43QjJ68F

"rf" command

imgonline-com-ua-twotoone-fvY5eRFXugcg

"pf" command

imgonline-com-ua-twotoone-AEEEVz9EqzLR7ky

"ls" command

imgonline-com-ua-twotoone-JL5HXwv2iprb0Ab

"Files"

Screenshot from 2022-09-17 12-16-48

About

A simple file system using C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published