Visual Studio 2022 should be installed, with Desktop development with C++ tools.
Clone the Repository.
Click on the In_memory_file_system.sln file, to open the project.
Click to on f5 to run the project.
So, I have used Trie for implementing the File system, a node of a trie represent and entity, and an entity can be a file/directory. A node of trie contains :
name(name of the file/directory)
children(a map of all the files/directories that a directory contains)
isDirectory( as the name suggests its a flag to differentiate between file and directory)
fullPath( full path relative to the root folder)
content( contents if the entity is a file)
Every entity has a children ".." which points to the parent except root. This child is added when we create an entity with command like touch and mkdir.
All the paths must be relative to current directory, absolute path will not work.
Description: Creates a new directory.
mkdir <directory_name>
Description: Changes the current directory to the specified path. Supports navigating to the parent directory using "..".
cd <path>
Description: Lists the contents of the current or specified directory.
ls [<directory_path>]
Description: Creates a new empty file in the current directory.
touch <filename>
Description: Writes the specified text to a file. There should be spaces around '>' for the command to work.
echo '<text>' > <filename>
Description: Displays the contents of the specified file.
cat <filename>
Description: Moves a file or directory from the source path to the destination path.
mv <source_path> <destination_path>
Description: Copies a file or directory from the source path to the destination path.
cp <source_path> <destination_path>
Description: Removes a file or directory from the current or specified path.
rm <path>