https://github.com/joway/mfs
Memory File System
https://github.com/joway/mfs
Last synced: about 1 year ago
JSON representation
Memory File System
- Host: GitHub
- URL: https://github.com/joway/mfs
- Owner: joway
- License: mit
- Created: 2017-03-01T12:03:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-02T04:41:34.000Z (over 9 years ago)
- Last Synced: 2025-01-25T00:37:15.438Z (over 1 year ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MFS
Memory File System
## Dependency
- Python3.5/3.6
## Run
python main.py
## Tests
python tests.py
## Usage
Help:
/---------------------------------------------------------\\
| CMD | Usage | Example |
----------------------------------------------------------
| ls | ls [path] | ls /root ; ls ../ ; ls ./ |
| mkdir | mkdir [path] | mkdir /root ; mkdir /etc/www |
| pwd | pwd | pwd |
| touch | touch name | touch x.c ; touch /root/x.c |
| tree | tree [path] | tree ; tree . ; tree /root |
| cd | cd [path] | cd /root ; cd ../ |
| fread | fread file_path | fread x.c ; fread /root/x.c|
| fwrite| fwrite file_path| fwrite x.c "dataxxx" |
| cp |cp s_name t_name | cp /root/s.txt /etc/t.txt |
| help | help | help |
| exit | exit | exit |
\---------------------------------------------------------/
## Summary
由于纯粹基于内存进行快速随机存储 , 且对文件夹中内容无排序需求, 树深度(目录层级)一般情况不会过深, 故而简单地采用一棵的自由树来组织目录结构。
每个子节点有两种类型 : Directory 和 File , 根节点自身是一个 Directory。