Code Monkey home page Code Monkey logo

file-system's Introduction

File-System

A simulation of file system

support operations as follows:

mkdir:          create a empty dir
rmdir:          rm a empty
mv:             move file, you can also move dir using '-r' options
ls:             list files and dirs
touch:          create empty file
rm:             delete file, you can also delete dir using  '-r' options
cp:             copy file, you can also copy dir using '-r' options
cat:            read file and show the content
write:          write to file
cd:             chdir
useradd:        add a user
userdel:        delete user
su:             change user
passwd:         change password of user
du:             show the size of file or dir
tree:           show the file tree
chmod:          change the authority of file or dir
exit:           exit

you can also use 'command?' to know more info about this command.

display

root:/root#ls
drwxr-xr-x          99        root           root           Wed Jan 13 13:10:16 2016      .              
drwxr-xr-x          0         root           root           Wed Jan 13 13:10:16 2016      ..             
root:/root#cd /
root:/#ls
drwxr-xr-x          0         root           root           Wed Jan 13 13:10:16 2016      .              
drwxr-xr-x          0         root           root           Wed Jan 13 13:10:16 2016      ..             
drwxr-xr-x          100       root           root           Wed Jan 13 13:10:16 2016      etc            
drwxr-xr-x          99        root           root           Wed Jan 13 13:10:16 2016      root           
drwxr-xr-x          98        root           root           Wed Jan 13 13:10:16 2016      home           
root:/#cd root
root:/root#mkdir a b
root:/root#cd a
root:/root/a#mkdir c
root:/root/a#cd c
root:/root/a/c#touch d
root:/root/a/c#cd ../../
root:/root#ls
drwxr-xr-x          99        root           root           Wed Jan 13 13:10:16 2016      .              
drwxr-xr-x          0         root           root           Wed Jan 13 13:10:16 2016      ..             
drwxr-xr-x          96        root           root           Wed Jan 13 13:18:15 2016      a              
drwxr-xr-x          95        root           root           Wed Jan 13 13:18:15 2016      b              
root:/root#tree
/root
|── a
|   |── c
|       |── d
|── b
root:/root#cp a b -r
root:/root#tree
/root
|── a
|   |── c
|       |── d
|── b
    |── a
        |── c
            |── d
root:/root#cp a c -0r
cp: 参数错误
root:/root#cp a c -r
root:/root#tree
/root
|── a
|   |── c
|       |── d
|── b
|   |── a
|       |── c
|           |── d
|── c
    |── c
        |── d
root:/root#^C
wait for save data
save ok

file-system's People

Contributors

messyidea avatar

Stargazers

sammar alaa eldeen avatar dushuang avatar Zitone He avatar  avatar

Watchers

James Cloos avatar  avatar

file-system's Issues

关于FileSystem的size的问题

您好!
请问
/*
super_node 1024字节
inode 64字节
block 512字节
1 block = 8 inode
(2 block) (1 block) (512 inode = 64 block) (1024 block)
*/

define FILESYSTEMSIZE (512 * (3 + 64 + 1024))

之间有联系吗?
这个FILESYSTEMSIZE的3是指的什么呢?
另外super_node用来存放什么信息?
谢谢您!打扰!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.