Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Virtual Storage System

Overview

This project is a prototype of a virtual storage system implemented in Python.
It simulates a simple filesystem using a text file (3.txt) as the storage medium.
Each file is stored as binary blocks inside a structured grid with metadata rows and data sectors.

At its current stage (v1), the system behaves like a note maker:

  • You can create a file (up to 256 bytes).
  • You can read back the file by its ID.
  • The system tracks metadata (filename, sector, block number, size).
  • Benchmark scripts measure performance of create/read operations.

Features (v1)

  • Storage initialization: Creates 3.txt with metadata region, gap lines, and data sectors.
  • File creation: newfile_store(Filename, Data) stores a file in the next free block.
  • File reading: read_file(Filename) retrieves file contents.
  • Binary conversion: ASCII characters are stored as 8-bit binary codes.
  • Benchmarking: benchmark.py runs test cases and logs results to CSV.

Benchmark Results (Sample)

  • Case 1 (empty): Create and read one file → fast (~0.8s create, ~0.08s read).
  • Case 2 (full): Creating last file slows down (~5.5s), reads remain fast (~0.02–0.04s).
  • Case 3 (many files): Create times grow steadily (file 22 took ~14s) due to metadata scanning.

Conclusion: Reads are efficient, but writes slow down as the number of files increases.


Planned Objectives (v2)

  1. Delete option

    • Ability to remove files and free their blocks.
  2. Increase storage size

    • Scale beyond 256 files × 256 bytes.
    • Make constants configurable for larger capacity.
  3. Basic GUI + file listing

    • Show all files in a simple interface.
    • Buttons for create, read, delete.
    • Display file contents.
  4. Optimization

    • Cache next free metadata slot and data block.
    • Avoid scanning the whole file each time.
    • Batch writes for speed.
    • Consider bitmap/index for free blocks.

Roadmap

  • v1: Backend prototype (create/read, benchmark).
  • v2: File management (delete, list), scaling, GUI, performance optimization.
  • Future: More advanced filesystem features (fragmentation handling, journaling, larger files).

Author

Krishna — experimenting with building a mini filesystem in Python.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages