Design In-Memory File System
Explore how to design an in-memory file system that supports directory creation, file listing, content addition, and content retrieval. Learn to implement core file system operations such as ls, mkdir, addContentToFile, and readContentFromFile, managing paths and content efficiently.
We'll cover the following...
We'll cover the following...
Statement
Design an in-memory file system. The skeleton for the class FileSystem is provided to you. Simulate the following functions:
-
ls(String path): If path is a file path, return a list that only contains the file’s name. If it’s a directory path, return the list of files and directory names in this directory. Your function should return the output (file and ...