資源簡介
杭電 操作系統課程設計 簡單文件系統的實現
杭電 操作系統課程設計 簡單文件系統的實現
杭電 操作系統課程設計 簡單文件系統的實現
代碼片段和文件信息
#include?
#include?
#include?
#include?
using?namespace?std;
//1代表普通文件2代表目錄文件0表示空文件
#define?GENERAL?1
#define?DIRECTORY?2
#define?HXSH?0
struct?FCB
{
char?fname[16];?//文件名
char?type;????
int?size;????//文件大小
int?fatherBlockNum;????//當前的父目錄盤塊號
int?currentBlockNum;????//當前的盤塊
void?initialize()
{
strcpy(fname“\0“);
type?=?HXSH;
size?=0;
fatherBlockNum?=?currentBlockNum?=?0;
}
};?
/*常量設置*/
const?char*?FilePath?=?“C:\\myfiles“;
const?int?BlockSize?=?512;???????//盤塊大小
const?int?OPEN_MAX?=?5;??????????//能打開最多的文件數
const?int?BlockCount?=?128;???//盤塊數
const?int?DiskSize?=?BlockSize*BlockCount;????//磁盤大小
const?int?BlockFcbCount?=?BlockSize/sizeof(FCB);//目錄文件的最多FCB數
int?OpenFileCount?=?0;
struct?OPENLIST??
- 上一篇:c++矩陣求逆矩陣源代碼 原創
- 下一篇:飛機訂票系統C語言版
評論
共有 條評論