We would like to build a terminal application, which will be able to interact with the file system.
The filesystem is composed of the following entities:
- File
- Folder - which can contain multiple files, folders, and/or symbolic links.
- Symbolic link - a reference to either a file, folder or symbolic link.
We can open a terminal in a specific folder.
Terminal lets us run the following functions:
- listFiles - should print the following line (file name, type, size) for each entity in the folder. (For symbolic links, you should present the size of the real file it references).
- listRecursiveFiles - should print a tree of entities in the current folder. To visualize subfolder depth, an indentation of 4 spaces should be used. Files are presented first, then sub-folders. For example:
folder file folder file folder file file
- calculateFolderSize - returns the size of everything contained in the current folder, including subfolders. Here, the symbolic links are counted as having no size.
- listFiles and listRecursiveFiles could get a following filters:
- Start with text
- End with text
- Contains text
- Type
- Greater than size
- cd - change the current folder (absolute)
- pwd - should print the current folder
- createFile (name and size) - create a file under the current folder
- createFolder (name) - create a folder under the current folder
- createSymbolicLink (name, reference) - create a symbolic link under the current folder
- Validation - entity name in specific folder is unique.
- Write unit tests