Skip to content

Unix-style in-memory filesystem with a tree-structured hierarchy written in C++.

Notifications You must be signed in to change notification settings

melliott18/memory-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

In-Memory File System Shell (yshell)

Overview

This project implements a Unix-like shell (yshell) that operates on an in-memory file system. It supports basic file and directory operations, mimicking a subset of standard shell commands.

Features

  • In-memory file system: No files are written to disk.
  • Supported commands:
    • cat, cd, echo, exit, ls, lsr, make, mkdir, prompt, pwd, rm, rmr
  • Path navigation and manipulation
  • Error handling for invalid commands and operations
  • Customizable shell prompt

Building

From the src/ directory, run:

make

This will build the yshell executable.

Usage

Run the shell:

./yshell

You can then enter commands similar to a Unix shell. For example:

mkdir foo
cd foo
make file1 some content
ls
cat file1
pwd
rm file1
cd /
rmdir foo
exit

Testing

Test scripts are located in the test/ directory. To run all tests:

cd test
bash mk.tests

This will execute all .ysh test scripts using the built yshell and compare outputs.

Example Test (test/test2.ysh)

make file this is the first file
make second file
make third file with more stuff in it
cat file
cat second
cat file second third
ls /

Dependencies

  • C++20 compiler (e.g., g++)
  • Standard Unix build tools (make)
  • Optional: valgrind for memory checking

File Structure

  • src/: Source code and Makefile
  • test/: Test scripts and test outputs

About

Unix-style in-memory filesystem with a tree-structured hierarchy written in C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published