freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

操作系統(tǒng)課程設(shè)計--模擬文件管理系統(tǒng)(編輯修改稿)

2024-12-22 15:58 本頁面
 

【文章內(nèi)容簡介】 m FileStatus { closed, opened, reading, writing } 。 //一個文件索引結(jié)構(gòu) (文件節(jié)點) struct FileIndexElement { unsigned Index。 //文件元素索引編號 char FileName[NAME_LEN]。 //文件元素名 char ParentName[NAME_LEN]。 //父節(jié)點名 unsigned FileBlockId。 //文件元素所在物理塊編號 unsigned FileLevel。 //文件元素所在層次,層+文件元素名為一個文件元素的邏輯位置 char creatTime[18]。//文件創(chuàng)建時間 char *filecontent。//文件內(nèi)容 BOOL effect。 //是否有效, 0無效, 1有效 FileType Type。 //識別文件還是目錄 }。 //文件索引結(jié)構(gòu)或目錄表項 (文件目錄結(jié)構(gòu)) struct FileIndex { FileIndexElement *FIStart。 //文件系統(tǒng)中的文件索引起始 位置 unsigned FILen。 //文件索引的最大長度 unsigned FICount。 //文件索引數(shù)量 }。 //文件塊的結(jié)構(gòu) (存儲數(shù)據(jù)塊結(jié)構(gòu)) struct FileBlock。 typedef struct FileBlock *pFileBlock。 struct FileBlock { unsigned FileBlockId。 //文件塊編號 unsigned BLOCK_SIZE。 //文件塊的容量 char *FileBlockAddr。 //文件塊地址 pFileBlock next。 //下一個文件塊的地址 }。 //文件系統(tǒng)的位示圖結(jié)構(gòu) (用于顯示分配的存儲器分配情況) struct BitMap { unsigned BITMAP_LEN。 //文件位示圖長度 char *BMStart。 //位示圖的起始指針 }。 //文件系統(tǒng)結(jié)構(gòu) (超級塊的結(jié)構(gòu) ,全局變量) struct SuperBlock { char *FSStart。 //文件系統(tǒng)的起始地址 unsigned SuperBlockSize。 //文件系統(tǒng)的容量 BitMap bm。 //文件系統(tǒng)中的位示圖 unsigned BLOCK_COUNT。 //文件系統(tǒng)中文件塊的數(shù)量 pFileBlock head。 //文件系統(tǒng)中文件塊首地址 FileIndex FI。 //文件系統(tǒng)中的文件索引 }。 //登陸用戶的數(shù)據(jù)結(jié)構(gòu) (用戶的數(shù)據(jù)結(jié)構(gòu)) struct User。 typedef struct User *pUser。 struct User { char *UserName。 //用戶名稱 char *password。 //用戶密碼 int isAdmin。 //用戶類型, 1表示管理員, 0表示用戶 pUser NextUser。 }。 struct LoginStruct{ int User_Login_tims。 int UserNum。 pUser pUserList。 }。 //文件系統(tǒng)中的元素結(jié)構(gòu),包括文件和文件夾 (邏輯文件的定義,樹形結(jié)構(gòu)) struct FSElement。 typedef struct FSElement *pFSElement。 struct FSElement { pFSElement parent。 //指向自己的父親節(jié)點 unsigned FileLevel。 //文件元素所在層次,層+文件元素名為一個文件元素的邏輯位置 char FileName[NAME_LEN]。 //文件元素名 unsigned FileBlockId。 //文件元素所在物理塊編號 unsigned FileElemLen。 //文件元素的長度 FileType Type。 //文件元素類型 FileAccess Access。 //文件元素可供操作的權(quán)限 User Creator。 //文件創(chuàng)建者 char CreateTime[18]。 //創(chuàng)建時間,日期格式: MM/DD/YY HH:MI:SS char LastModTime[18]。 //最后一次修改時間 char *FileData。 //一個文件的數(shù)據(jù)開始地址, 文件夾時該值為 NULL FileStatus fileStu。 //如果是一個文件表示文件當(dāng)前的狀態(tài) }。 //系統(tǒng)當(dāng)前狀態(tài) struct CurrentStatus { User CurrentUser。 //當(dāng)前用戶 unsigned FileLevel。 //用戶所在文件系統(tǒng)層 FSElement *CurrParent。 //當(dāng)前層的父節(jié)點 char *CurrentPath。 //當(dāng)前路徑 }。 SuperBlock FS。 //一個全局文件系統(tǒng)的變量 CurrentStatus CS。 //當(dāng)前系統(tǒng)狀態(tài) FSElement *base。 //文件元素的根 LoginStruct LoginS。//用戶列表,在登錄的時候用到,以鏈表形式存儲 bool InitFileSys()。 //(初始化文件函數(shù)) //======================================================================================== //函數(shù)說明:權(quán)利 聲明 void Right(void) { cout文件管理系統(tǒng) [版本 ]\n。 cout版權(quán)所有 (c) 2020 計算機 4班。保留所有權(quán)利。 \n\n。 return。 } //========================================================================================== // 函數(shù)介紹:尋找第一個 空白 的文件塊 ID // 返 回 值:返回第一個空白塊的 ID unsigned FindBlankFileBlockId(void) { unsigned char c。 //通過位示圖 查找 可以簡化 for (unsigned i = 0。 i / 8。 i++) { c = [i] | 0x7F。 if (c == 0x7F) { return i * 8。 //一個字節(jié)左邊第一位為 0,表示該區(qū)域未使用 } c = [i] | 0xBF。 if (c == 0xBF) { return i * 8 + 1。 } c = [i] | 0xDF。 if (c == 0xDF) { return i * 8 + 2。 } c = [i] | 0xEF。 if (c == 0xEF) { return i * 8 + 3。 } c = [i] | 0xF7。 if (c == 0xF7) { return i * 8 + 4。 } c = [i] | 0xFB。 if (c == 0xFB) { return i * 8 + 5。 } c = [i] | 0xFD。 if (c == 0xFD) { return i * 8 + 6。 } c = [i] | 0xFE。 if (c == 0xFE) { return i * 8 + 7。 } } return BLOCK_COUNT + 1。 } //================================================================================================ // 函數(shù)介紹:尋找第一個 文件塊地址 (根據(jù)文件塊 ID,找文件塊) // 輸入?yún)?shù): fileblockid 文件塊 ID // 返 回 值:返回文件塊的地址 char * FindBlankFileBlock(unsigned fileblockid) { FileBlock *fblock = 。 while (fblocknext != NULL) { if (fblockFileBlockId == fileblockid) { return fblockFileBlockAddr。 //如果找到文件塊,返回文件塊的地址, } else { fblock = fblocknext。 } } return NULL。 //沒有找到,返回空。 } //================================================================================================== // 函數(shù)介紹:得到當(dāng)前時間的字符串 // 輸入?yún)?shù):時間字符串的指針 void GetCurrent_Time(char *currtime) { char dbuffer [9]。 char tbuffer [9]。 _strdate(dbuffer)。 //獲得日期 _strtime(tbuffer)。 //獲得時間 strcpy(currtime, dbuffer)。 strcat(currtime, )。 strcat(currtime, tbuffer)。 //將兩者拼接在一起,并用空格隔開 } //================================================================================================================= // 函數(shù)介紹:更新文件索引 // 輸入?yún)?shù): fileblockid 文件塊 ID void AddFileIndex(unsigned fileblockid, unsigned filelevel, char *filename, char *parentname,FileType temp) { [].FileBlockId = fileblockid。 [].FileLevel = filelevel。 strcpy([].FileName, filename)。 [].Type = temp。 if (parentname == NULL) { memset([].ParentName, 39。\039。, NAME_LEN)。 //如果沒有父親節(jié)點的話,將其父親節(jié)點格式化 } else { strcpy([].ParentName, parentname)。 } [].Index = 。 [].effect = 1。 GetCurrent_Time([].creatTime)。 ++。 } //================================================================================================== // 函數(shù)介紹:更新位示圖 // 輸入?yún)?shù): fileblockid 文件塊 ID 更改對應(yīng)的位示圖 vo
點擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1