Code Monkey home page Code Monkey logo

filesystem's Introduction

基于两级目录结构的简单文件系统的管理与操作

问题描述

​ 为了模拟文件系统实现的基本功能,了解文件系统的基本结构和文件的各种管理方法,加深理解文件系统的内部功能及内部实现,理解文件管理的工作过程,加深各种文件操作命令的实质内容和执行过程的了解,现要求编程模拟一个简单的文件系统,以实现对文件系统的管理和控制功能,支持用户对自己文件的管理与操作。

具体要求

  • 要求本文件系统采用两级目录,即设置主文件目录[MFD]和用户文件目录[UED]。在主文件目录中,每个用户目录都占有一个目录项,其目录项中包含文件名和指向该文件目录文件。在用户文件目录UFD中,这些文件目录具有相似的结构,它由用户文件的文件块组成。另外,可考虑为打开文件设置运行文件目录[AFD]。具体测试时可考虑:设计一个10个用户的文件系统,每次用户可保存10个文件,一次运行用户可以打开5个文件,并需要对文件设置保护措施。
  • 设计并实现Create、Open、Read、Write、Close、Delete等文件命令的算法,以实现用户通过菜单方式或者API方式实现对自己文件的管理。

设计方案

数据结构

  • FCB
  • 文件目录结构
  • 文件索引表
  • 系统打开表
  • 用户打开表

模块划分

Usage模块

描述文件系统使用方法

User模块

负责用户的登录部分

  • 账户、密码正确性检测
  • 修改与当前登入用户相关的信息
  • 读取用户的命令,检测是否合理
  • 判断用户是否有权限访问
  • 调用Manager部分的API实现用户指令
FileDirectory模块

文件目录部分

class FileDirectory {
public:
    FCB* OpenFile(int fd);
    FCB* FindPos(char* path, char* state);
}
FileAccess模块

文件存储管理部分

Manager模块

实现用户/系统命令模块

filesystem's People

Contributors

cminusqaq avatar murphyowo avatar

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.