View Code? Open in Web Editor
NEW
A simple Linux file system simulator written in C
License: MIT License
linuxfilesystemsim's Introduction
Linux File System Tree Simulator
Requirements (to compile it as a 32-bit executable)
- Linux 32-bit support libraries, you can install them with:
sudo apt install gcc-multilib
- Compile (32-bit):
gcc -m32 linux_file_system_tree_sim.c
- Run it and enjoy:
./a.out
mkdir <pathname>
: create a new directory node in the file system tree;
rmdir <pathname>
: remove an empty directory from the file system tree;
cd [<pathname>]
: change the current working directory;
ls [<pathname>]
: list the directory contents;
pwd
: print the (absolute) path to the current working directory;
create <pathname>
: create a new file node in the file system tree;
rm <pathname>
: remove a file from the file system tree;
save <filename>
: save the current file system tree as a text file (.txt);
reload <filename>
: construct a file system tree from a well formatted text file;
menu
: show the current help menu;
prompt <prompt>
: change the command prompt text;
quit
: save the file system tree as "file_system_tree.txt" and quit.