This is a secondary file system of a unix-like operating system, a file "Disk.img" with 64MB memory space is used to simulate a disk device.
git clone https://github.com/Moondok/Moon-FS.git
cd Moon-FS
mkdir build && cd build
cmake .. && make
./Moon_FS
you can test our file system via following test cases.
- make directories
cd home
mkdir texts
mkdir reports
mkdir photos
- test small/medium/large files
test image
test doc
test readme
note that the instruction test
is specially designed for testing the system.
- create/open/write/read a file
in the following case, we create a file with a size of 800B, then we read 500 bytes from the position 500(300B in fact), then we write these 300B into the end of the file. Thus finally the size of the file will be 1100B.
cd ../
mkdir test
touch test/Jerry
open test/Jerry rw
write 0
800
00234567890123456789022345678903234567890423456789052345678906234567890723456789082345678909234567891023456789112345678912234567891323456789142345678915234567891623456789172345678918234567891923456789202345678921234567892223456789232345678924234567892523456789262345678927234567892823456789292345678930234567893123456789322345678933234567893423456789352345678936234567893723456789382345678939234567894023456789412345678942234567894323456789442345678945234567894623456789472345678948234567894923456789502345678951234567895223456789532345678954234567895523456789562345678957234567895823456789592345678960234567896123456789622345678963234567896423456789652345678966234567896723456789682345678969234567897023456789712345678972234567897323456789742345678975234567897623456789772345678978234567897923456789
seekp 0 500 0
read 0
500
write 0
300
502345678951234567895223456789532345678954234567895523456789562345678957234567895823456789592345678960234567896123456789622345678963234567896423456789652345678966234567896723456789682345678969234567897023456789712345678972234567897323456789742345678975234567897623456789772345678978234567897923456789
seekp 0 0 0
read 0
1100
close 0
- mkdir
- ls
- touch
- stat
- mv
- cd
- cp
- multi-users support