This project was developed for the Advanced Programming module during the second year of my degree.
It simulates a command-line file system , allowing users to navigate, inspect, and modify a virtual directory tree using basic shell-like commands.
The application models files and directories as C++ objects and builds an in-memory representation of the current working directory and its subdirectories using the <filesystem> library.
It provides a command-driven interface to:
- Navigate between directories (
cd,dir) - Sort files by name or size
- Create, copy, and delete files or folders dynamically
- Persist and reload the in-memory representation via CSV export/import
| Command | Description |
|---|---|
CD <name> |
Change the current working directory. Use cd .. to move up one level. |
DIR |
Display the contents of the current directory. |
SORTSIZE |
Sort files by size (ascending). Use /r for descending. |
SORTNAME |
Sort files alphabetically (ascending). Use /r for descending. |
MKFILE <name> |
Create a new file with a random size. |
MKDIR <name> |
Create a new folder. |
DEL <name> |
Delete the specified file or folder. |
COPY <source> <destination> |
Copy an existing file to a new name. |
WRITE |
Export the in-memory representation to saved-memory.csv. |
READ |
Import the in-memory structure from saved-memory.csv. |
COMMANDS |
Display a list of all available commands. |
EXIT |
Terminate the program. |
| File | Purpose |
|---|---|
main.cpp |
Entry point, input loop, and directory traversal |
Item.h / Item.cpp |
Base class for files and folders |
File.h / File.cpp |
File-specific behaviour and printing |
Folder.h / Folder.cpp |
Folder logic and parent/child management |
Commands.h / Commands.cpp |
Commands for the program |
- Written in C++17
- My first project in C++
- Designed for Windows - Not tested on other platforms
- Originally completed in 2024 - cleaned and documented in 2025.