Skip to content

A series of data structures designed to simulate the ability to interact with a filesystem and its directories and files through commands (written in Scala)

Notifications You must be signed in to change notification settings

brehar/scala-filesystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Scala Filesystem

This is an application designed to simulate an interactive Unix-type filesystem, written in Scala.

Data Structures

The filesystem is composed of a series of immutable data structures called DirEntry, which can either be a File or a Directory.

State

The application transforms an immutable series of DirEntry data structures into a (potentially) new series of DirEntry data structures through the use of Commands.

Supported Commands

  1. mkdir [argument]: adds a Directory to the filesystem.
  2. touch [argument]: adds a File to the filesystem.
  3. ls: lists the files and directories in the current working directory.
  4. pwd: prints out the current working directory.
  5. 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.
  6. rm [argument]: removes the specified DirEntry from the filesystem.
  7. 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.
  8. cat [argument]: prints out the contents of the specified file.

About

A series of data structures designed to simulate the ability to interact with a filesystem and its directories and files through commands (written in Scala)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages