This is an application designed to simulate an interactive Unix-type filesystem, written in Scala.
The filesystem is composed of a series of immutable data structures called DirEntry, which can either be a File or a Directory.
The application transforms an immutable series of DirEntry data structures into a (potentially) new series of DirEntry data structures through the use of Commands.
- mkdir [argument]: adds a Directory to the filesystem.
- touch [argument]: adds a File to the filesystem.
- ls: lists the files and directories in the current working directory.
- pwd: prints out the current working directory.
- cd [argument]: changes the current directory to the specified working directory.
- Absolute and relative paths are both supported.
- The relative token '.' (indicating the current directory) is supported.
- The relative token '..' (indicating the parent directory) is supported.
- rm [argument]: removes the specified DirEntry from the filesystem.
- echo [(optional) contents] [(optional) operator] [(optional) filename]:
- Without an operator specified, the echo command will simply repeat back the contents.
- If the ">" operator is specified, contents will be written to the indicated file, which will be created as necessary.
- If the ">>" operator is specified, contents will be appended to the indicated file, which will be created if it does not already exist.
- cat [argument]: prints out the contents of the specified file.