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.
- Storage initialization: Creates
3.txtwith 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.pyruns test cases and logs results to CSV.
- 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.
-
Delete option
- Ability to remove files and free their blocks.
-
Increase storage size
- Scale beyond 256 files × 256 bytes.
- Make constants configurable for larger capacity.
-
Basic GUI + file listing
- Show all files in a simple interface.
- Buttons for create, read, delete.
- Display file contents.
-
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.
- 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).
Krishna — experimenting with building a mini filesystem in Python.