![虛擬文件系統(tǒng)_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/6b6f78b5-0e4a-436d-b694-c67ee46ae83d/6b6f78b5-0e4a-436d-b694-c67ee46ae83d1.gif)
![虛擬文件系統(tǒng)_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/6b6f78b5-0e4a-436d-b694-c67ee46ae83d/6b6f78b5-0e4a-436d-b694-c67ee46ae83d2.gif)
![虛擬文件系統(tǒng)_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/6b6f78b5-0e4a-436d-b694-c67ee46ae83d/6b6f78b5-0e4a-436d-b694-c67ee46ae83d3.gif)
![虛擬文件系統(tǒng)_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/6b6f78b5-0e4a-436d-b694-c67ee46ae83d/6b6f78b5-0e4a-436d-b694-c67ee46ae83d4.gif)
![虛擬文件系統(tǒng)_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/6b6f78b5-0e4a-436d-b694-c67ee46ae83d/6b6f78b5-0e4a-436d-b694-c67ee46ae83d5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、虛擬文件系統(tǒng)學(xué)生課程設(shè)計報告 2014 2015 學(xué)年 第 二 學(xué)期學(xué) 院 XXXXXXXXX 專 業(yè) 軟件工程 學(xué) 號 姓 名 指導(dǎo)教師 起 止 周周數(shù)1實習(xí)地點課程設(shè)計目的:1、 理解文件系統(tǒng)功能2、 完成對文件、目錄及磁盤空間的管理并提供操作命令3、 實現(xiàn)文件共享與保護課程設(shè)計要求:1、利用索引結(jié)點實現(xiàn)目錄管理。2、建立一個樹形目錄系統(tǒng),目錄文件及索引結(jié)點均用結(jié)構(gòu)數(shù)組表示。3、文件盤塊采用FAT方式,空指針用-1表示,并設(shè)空閑盤塊指針。4、提供對文件、目錄及磁盤空間的操作命令。進度安排及主要內(nèi)容:第一周:完成用戶登錄,目錄管理和文件管理第二周:成績:指導(dǎo)教師(簽字)年 月 日一、概述1.
2、1 本文的目的本文內(nèi)容用于指導(dǎo)學(xué)生對課程設(shè)計報告的格式和內(nèi)容安排進行控制。學(xué)生在使用時,可直接用格式刷將本文對應(yīng)部分的格式內(nèi)容進行提取并加載到目標位置;對于封面、頁眉等部分,請直接修改相關(guān)文字。二、需求分析本次要實現(xiàn)虛擬文件系統(tǒng),主要功能有用戶登錄、子目錄的創(chuàng)建、刪除、子目錄中項的顯示;文件的創(chuàng)建、打開、刪除、關(guān)閉、對文件進行讀寫等。實現(xiàn)對目錄和文件的基本操作和文件的共享與保護。三、技術(shù)方案本次課程設(shè)計用VS2013編寫C+控制臺程序模擬文件系統(tǒng)。系統(tǒng)初始時需要登錄,登錄成功方能對文件進行操作。本虛擬文件系統(tǒng)采用兩級目錄,第一級目錄對應(yīng)用戶賬號,第二級目錄對應(yīng)用戶下的文件。文件系統(tǒng)的數(shù)據(jù)結(jié)構(gòu)包
3、括主目錄(虛擬C盤)、子目錄及所含文件等。三者都存放在磁盤中,方便進行操作。文件可以在目錄中進行記錄,表明文件所在目錄。四、總體設(shè)計4.1功能設(shè)計1、首次運行系統(tǒng)需要先格式化磁盤空間,申請一個內(nèi)存為1M的磁盤空間。2、用戶登錄,用戶需輸入正確的用戶名和密碼方能進入本系統(tǒng)進行文件和目錄的操作。3、進入系統(tǒng)后可根據(jù)提示對文件和目錄進行操作。4.2虛擬文件系統(tǒng)算法流程圖 算法流程圖4-1五、詳細設(shè)計5.1系統(tǒng)功能說明1、 創(chuàng)建子目錄:輸入createdir 目錄名,即進行目錄創(chuàng)建操作,若當前目錄已滿或文件名已經(jīng)存在則創(chuàng)建失敗,返回失敗信息。否則創(chuàng)建成功,并找到空閑磁盤塊,將該磁盤塊設(shè)為已分配,填寫目
4、錄項。2、 刪除子目錄:removedir 目錄名,檢查當前目錄項中有無該目錄,判斷要刪除的目錄有無子目錄,如果有子目錄將其釋放,進行刪除操作。3、 更改當前目錄:cd 目錄名,可以進入到子目錄并回退上級目錄。4、 顯示目錄中項:showdir可以顯示目錄和文件,文件顯示大小,目錄顯示目錄。5、 文件操作:創(chuàng)建文件、打開文件(創(chuàng)建時自動打開該文件),刪除文件,關(guān)閉文件、讀文件、寫文件、6、 退出5.2數(shù)據(jù)結(jié)構(gòu)struct direct/*文件控制快信息*/struct FCBchar name9; /文件/目錄名8位char property; /屬性1位目錄0位普通文件int size; /
5、文件/目錄字節(jié)數(shù)、盤塊數(shù))int firstdisk; /文件/目錄起始盤塊號int next; /子目錄起始盤塊號int sign; /1是根目錄0不是根目錄directitemMSD + 2;/*size 8*/struct fatitemint item; /存放文件下一個磁盤的指針char em_disk; /磁盤塊是否空閑標志位0 空閑;struct opentablestruct openttableitemchar name9; /文件名int firstdisk; /起始盤塊號int size; /文件的大小openitemMOFN;int cur_size; /當前打文件的數(shù)
6、目;struct fatitem *fat; /FAT表struct direct *root; /根目錄struct direct *cur_dir; /當前目錄struct opentable u_opentable; /文件打開表5.3方法函數(shù)void initfile();void format();void enter();void init();int create(char *name);int open(char *name);int close(char *name);int write(int fd, char *buf, int len);int read(int fd,
7、 char *buf);int del(char *name);int createdir(char *name);int removedir(char *name);void showdir();int cd(char *name);void print();void show();void login();5.4全局變量#define MEM_D_SIZE 1024*1024 /總磁盤空間為M#define DISKSIZE 1024/磁盤塊的大小K#define DISK_NUM 1024/磁盤塊數(shù)目K#define FATSIZE DISK_NUM*sizeof(struct fati
8、tem)/FAT表大小#define ROOT_DISK_NO FATSIZE/DISKSIZE+1/根目錄起始盤塊號#define ROOT_DISK_SIZE sizeof(struct direct)/根目錄大小#define DIR_MAXSIZE 1024/路徑最大長度為KB#define MSD 6/最大子目錄數(shù)#define MOFN 4/最大文件深度為#define MAX_WRITE 1024*128/最大寫入文字長度KB char *username = (char *)malloc(sizeof(char) * 100);char *password = (char *)
9、malloc(sizeof(char) * 100);六、軟件測試6.1格式化磁盤空間測試6.2用戶登錄測試6.3創(chuàng)建子目錄測試6.4進入子目錄測試6.5創(chuàng)建文件測試6.6寫入文件測試6.7讀文件測試6.8返回上級目錄測試6.9顯示目錄中項測試6.10讀寫權(quán)限測試七、總結(jié)本次課程設(shè)計我初步完成了虛擬文件系統(tǒng)的目錄管理和文件管理。讓我對于文件系統(tǒng)有了深層次的理解和掌握,通過自己編寫程序逐步提高自己的編程能力,并從中體會到了很多樂趣和知識。同時讓我對C語言中的指針有了一個更深的了解。由于以前對于C+知識沒有掌握牢固,使我在編程中出現(xiàn)了很多錯誤。費了很多時間,但是我通過不斷學(xué)習(xí)也提高了很多,對一些細
10、節(jié)的結(jié)構(gòu)體等也有了一個更深的理解。這次課程設(shè)計讓我進行了以前課堂很少有的實踐訓(xùn)練,雖然掌握的知識有限,但是這次經(jīng)歷讓我提高了編程能力和編程思想,使我受益匪淺。附錄1參考文獻1 譚浩強,C+程序設(shè)計(第2版)清華大學(xué)出版社,2012.2 湯小丹、梁紅兵、哲鳳屏,計算機操作系統(tǒng)西安電子科技大學(xué)出版社,2014. 3 嚴蔚敏數(shù)據(jù)結(jié)構(gòu)清華大學(xué)出版社.,2007附錄2源碼/ kcsj001.cpp : Defines the entry point for the console application./#include "stdafx.h"#include<stdio.h&
11、gt; #include<string.h> #include<stdlib.h> #define MEM_D_SIZE 1024*1024 /總磁盤空間為M#define DISKSIZE 1024/磁盤塊的大小K#define DISK_NUM 1024/磁盤塊數(shù)目K#define FATSIZE DISK_NUM*sizeof(struct fatitem)/FAT表大小#define ROOT_DISK_NO FATSIZE/DISKSIZE+1/根目錄起始盤塊號#define ROOT_DISK_SIZE sizeof(struct direct)/根目錄大小
12、#define DIR_MAXSIZE 1024/路徑最大長度為KB#define MSD 6/最大子目錄數(shù)#define MOFN 4/最大文件深度為#define MAX_WRITE 1024*128/最大寫入文字長度KB char *username = (char *)malloc(sizeof(char) * 100);char *password = (char *)malloc(sizeof(char) * 100);struct direct/*文件控制快信息*/struct FCBchar name9; /文件/目錄名8位char property; /屬性1位目錄0位普通文
13、件int size; /文件/目錄字節(jié)數(shù)、盤塊數(shù))int firstdisk; /文件/目錄起始盤塊號int next; /子目錄起始盤塊號int sign; /1是根目錄0不是根目錄directitemMSD + 2;/*size 8*/struct fatitemint item; /存放文件下一個磁盤的指針char em_disk; /磁盤塊是否空閑標志位0 空閑;struct opentablestruct openttableitemchar name9; /文件名int firstdisk; /起始盤塊號int size; /文件的大小openitemMOFN;int cur_si
14、ze; /當前打文件的數(shù)目;struct fatitem *fat; /FAT表struct direct *root; /根目錄struct direct *cur_dir; /當前目錄struct opentable u_opentable; /文件打開表int fd = -1; /文件打開表的序號char *bufferdir; /記錄當前路徑的名稱char *fdisk; /虛擬磁盤起始地址void initfile();void format();void enter();void halt();int create(char *name);int open(char *name);
15、int close(char *name);int write(int fd, char *buf, int len);int read(int fd, char *buf);int del(char *name);int mkdir(char *name);int rmdir(char *name);void dir();int cd(char *name);void print();void show();void login();main()FILE *fp;char ch;char a100;char code1110;char name10;int i, flag, r_size;c
16、har *contect;contect = (char *)malloc(MAX_WRITE*sizeof(char);if (fp = fopen("disk.dat", "rb") = NULL)printf("您還沒有格式化,是否格式化?(y/n)");scanf("%c", &ch);if (ch = 'y')initfile();printf("格式化成功! n");elsereturn 0;printf("您還未登錄,請先登錄! n");
17、GotoTest:login();if (strcmp(username, "readonly") != 0 | strcmp(password, "1234") != 0)&& (strcmp(username, "root") != 0 | strcmp(password, "root") != 0) && (strcmp(username, "nopower") != 0 | strcmp(password, "1234") != 0)p
18、rintf("登錄失敗,請重新登錄! n");goto GotoTest;printf("登錄成功! n");enter();print();show();strcpy(code0, "exit");strcpy(code1, "create");strcpy(code2, "open");strcpy(code3, "close");strcpy(code4, "write");strcpy(code5, "read");strcpy
19、(code6, "del");strcpy(code7, "createdir");strcpy(code8, "removedir");strcpy(code9, "showdir");strcpy(code10, "cd");while (1)scanf("%s", a);for (i = 0; i<11; i+)if (!strcmp(codei, a)break;switch (i)case 0: /退出文件系統(tǒng)free(contect);halt();retu
20、rn 0;case 1: /創(chuàng)建文件scanf("%s", name);flag = create(name);if (flag = -1)printf("Error: n 長度太長 !n");else if (flag = -2)printf("Error: n 子目錄已滿 !n");else if (flag = -3)printf("Error: n 打開文件次數(shù)過多 !n");else if (flag = -4)printf("Error: n 名字已經(jīng)在子目錄中 !n");else
21、if (flag = -5)printf("Error: n 磁盤空間已滿!n");elseprintf("創(chuàng)建文件成功! n");show();break;case 2:/打開文件scanf("%s", name);fd = open(name);if (fd = -1)printf("Error: n 打開的文件不存在! n");else if (fd = -2)printf("Error: n 文件已經(jīng)打開! n");else if (fd = -3)printf("Error:
22、 n 打開文件次數(shù)過多! n");else if (fd = -4)printf("Error: n 這是一個子目錄,不能打開進行讀寫! n");elseprintf("打開成功! n");show();break;case 3:/關(guān)閉文件scanf("%s", name);flag = close(name);if (flag = -1)printf("Error:n 文件沒有打開 ! n");elseprintf("關(guān)閉成功! n");show();break;case 4:/寫文
23、件if (fd = -1)printf("Error:n文件沒有打開 ! n");elseif (strcmp(username, "readonly") != 0 && strcmp(username, "nopower") != 0)printf("請輸入文件內(nèi)容:");scanf("%s", contect);flag = write(fd, contect, strlen(contect);if (flag = 0)printf("寫入成功! n");
24、elseprintf("Error:n 磁盤大小沒滿! n");elseprintf("您沒有寫入權(quán)限!n");show();break;case 5:/讀文件if (fd = -1)printf("Error:n 文件沒有打開 ! n");elseif (strcmp(username, "nopower") != 0)flag = read(fd, contect);if (flag = 0)for (i = 0; i<u_opentable.openitemfd.size; i+)printf(&quo
25、t;%c", contecti);printf("tn");elseprintf("您沒有讀取權(quán)限!n");show();break;case 6:/刪除文件scanf("%s", name);flag = del(name);if (flag = -1)printf("Error:n 文件不存在! n");else if (flag = -2)printf("Error:n 文件已經(jīng)打開,請先關(guān)閉它 ! n");else if (flag = -3)printf("Erro
26、r:n 刪除的不是文件 ! n");elseprintf("刪除成功! n");show();break;case 7:/創(chuàng)建子目錄scanf("%s", name);flag = mkdir(name);if (flag = -1)printf("Error:n 名稱長度太長! n");else if (flag = -2)printf("Error:n 子目錄已滿 ! n");else if (flag = -3)printf("Error:n 名稱已在子目錄中 ! n");els
27、e if (flag = -4)printf("Error: n '.' 或 '.' 不能作為子目錄名稱!n");else if (flag = -5)printf("Error: n 磁盤空間已滿!n");else if (flag = 0)printf("創(chuàng)建子目錄成功! n");show();break;case 8:/刪除子目錄scanf("%s", name);flag = rmdir(name);if (flag = -1)printf("Error:n 子目錄
28、不存在! n");else if (flag = -2)printf("Error:n子目錄中含有子目錄,請刪除子目錄中的子目錄!n");else if (flag = -3)printf("Error:n 刪除的不是子目錄 ! n");else if (flag = 0)printf("刪除子目錄成功! n");show();break;case 9:/顯示當前子目錄dir();show();break;case 10:/更改當前目錄scanf("%s", name);flag = cd(name);i
29、f (flag = -1)printf("Error:n 路徑不正確!n");else if (flag = -2)printf("Error:n打開的不是子目錄!n");show();break;default:printf("n Error!n 命令錯誤! n");show();void login()printf("請輸入用戶名:n");scanf("%s", username);printf("請輸入密碼:n");scanf("%s", passw
30、ord);void format()int i;FILE *fp;fat = (struct fatitem *)(fdisk + DISKSIZE); /計算FAT表地址,引導(dǎo)區(qū)向后偏移1k/*初始化FAT表*/fat0.item = -1; /引導(dǎo)塊fat0.em_disk = '1'for (i = 1; i<ROOT_DISK_NO - 1; i+) /存放FAT表的磁盤塊號fati.item = i + 1;fati.em_disk = '1'fatROOT_DISK_NO.item = -1; /存放根目錄的磁盤塊號fatROOT_DISK_N
31、O.em_disk = '1'for (i = ROOT_DISK_NO + 1; i<DISK_NUM; i+)fati.item = -1;fati.em_disk = '0'root = (struct direct *)(fdisk + DISKSIZE + FATSIZE); /根目錄的地址/*初始化目錄*/指向當前目錄的目錄項root->directitem0.sign = 1;root->directitem0.firstdisk = ROOT_DISK_NO;strcpy(root->, &
32、quot;.");root->directitem0.next = root->directitem0.firstdisk;root->perty = '1'root->directitem0.size = ROOT_DISK_SIZE;/指向上一級目錄的目錄項root->directitem1.sign = 1;root->directitem1.firstdisk = ROOT_DISK_NO;strcpy(root->, ".");root
33、->directitem1.next = root->directitem0.firstdisk;root->perty = '1'root->directitem1.size = ROOT_DISK_SIZE;if (fp = fopen("disk.dat", "wb") = NULL)printf("Error:n 不能打開文件 n");return;for (i = 2; i<MSD + 2; i+) /子目錄初始化為空root->directi
34、temi.sign = 0;root->directitemi.firstdisk = -1;strcpy(root->, "");root->directitemi.next = -1;root->perty = '0'root->directitemi.size = 0;if (fp = fopen("disk.dat", "wb") = NULL)printf("Error:n 不能打開文件 n");r
35、eturn;if (fwrite(fdisk, MEM_D_SIZE, 1, fp) != 1) /把虛擬磁盤空間保存到磁盤文件中printf("Error:n 文件寫入出錯! n");fclose(fp);void initfile()fdisk = (char *)malloc(MEM_D_SIZE*sizeof(char); /申請1M空間format();printf("install.n");void enter()FILE *fp;int i;fdisk = (char *)malloc(MEM_D_SIZE*sizeof(char); /申
36、請1M空間if (fp = fopen("disk.dat", "rb") = NULL)printf("Error:n不能打開文件n");return;if (!fread(fdisk, MEM_D_SIZE, 1, fp) /把磁盤文件disk.dat 讀入虛擬磁盤空間(內(nèi)存)printf("Error:n不能讀取文件n");exit(0);fat = (struct fatitem *)(fdisk + DISKSIZE); /找到FAT表地址root = (struct direct *)(fdisk +
37、DISKSIZE + FATSIZE);/找到根目錄地址fclose(fp);/*初始化用戶打開表*/for (i = 0; i<MOFN; i+)strcpy(u_, "");u_opentable.openitemi.firstdisk = -1;u_opentable.openitemi.size = 0;u_opentable.cur_size = 0;cur_dir = root; /當前目錄為根目錄bufferdir = (char *)malloc(DIR_MAXSIZE*sizeof(char);strc
38、py(bufferdir, "C:Usersbenchao");void halt()FILE *fp;int i;if (fp = fopen("disk.dat", "wb") = NULL)printf("Error:n不能打開文件n");return;if (!fwrite(fdisk, MEM_D_SIZE, 1, fp) /把虛擬磁盤空間(內(nèi)存)內(nèi)容讀入磁盤文件disk.datprintf("Error:n文件寫入出錯!n");fclose(fp);free(fdisk);free(
39、bufferdir);return;int create(char *name)int i, j;if (strlen(name)>8) /文件名大于8位return(-1);for (j = 2; j<MSD + 2; j+) /檢查創(chuàng)建文件是否與已存在的文件重名if (!strcmp(cur_dir->, name)break;if (j<MSD + 2) /文件已經(jīng)存在return(-4);for (i = 2; i<MSD + 2; i+) /找到第一個空閑子目錄if (cur_dir->directitemi.fir
40、stdisk = -1)break;if (i >= MSD + 2) /無空目錄項return(-2);if (u_opentable.cur_size >= MOFN) /打開文件太多return(-3);for (j = ROOT_DISK_NO + 1; j<DISK_NUM; j+) /找到空閑盤塊j 后退出if (fatj.em_disk = '0')break;if (j >= DISK_NUM)return(-5);fatj.em_disk = '1' /將空閑塊置為已經(jīng)分配/*填寫目錄項*/strcpy(cur_dir-
41、>, name);cur_dir->directitemi.firstdisk = j;cur_dir->directitemi.size = 0;cur_dir->directitemi.next = j;cur_dir->perty = '0'fd = open(name);return 0;int open(char *name)int i, j;for (i = 2; i<MSD + 2; i+) /文件是否存在if (!strcmp(cur_dir->directi
42、, name)break;if (i >= MSD + 2)return(-1);/是文件還是目錄if (cur_dir->perty = '1')return(-4);/文件是否打開for (j = 0; j<MOFN; j+)if (!strcmp(u_, name)break;if (j<MOFN) /文件已經(jīng)打開return(-2);if (u_opentable.cur_size >= MOFN) /*文件打開太多*/return(-3);/查
43、找一個空閑用戶打開表項for (j = 0; j<MOFN; j+)if (u_opentable.openitemj.firstdisk = -1)break;/填寫表項的相關(guān)信息u_opentable.openitemj.firstdisk = cur_dir->directitemi.firstdisk;strcpy(u_, name);u_opentable.openitemj.size = cur_dir->directitemi.size;u_opentable.cur_size+;/返回用戶打開表表項的序號retu
44、rn(j);int close(char *name)int i;for (i = 0; i<MOFN; i+)if (!strcmp(u_, name)break;if (i >= MOFN)return(-1);/清空該文件的用戶打開表項的內(nèi)容strcpy(u_, "");u_opentable.openitemi.firstdisk = -1;u_opentable.openitemi.size = 0;u_opentable.cur_size-;return
45、0;int write(int fd, char *buf, int len)char *first;int item, i, j, k;int ilen1, ilen2, modlen, temp;/用$ 字符作為空格# 字符作為換行符char Space = 32;char Endter = 'n'for (i = 0; i<len; i+)if (bufi = '$')bufi = Space;else if (bufi = '#')bufi = Endter;/取用戶打開表對應(yīng)表項第一個盤塊號item = u_opentable.o
46、penitemfd.firstdisk;/找到當前目錄所對應(yīng)表項的序號for (i = 2; i<MSD + 2; i+)if (cur_dir->directitemi.firstdisk = item)break;temp = i; /存放當前目錄項的下標/找到的item 是該文件的最后一塊磁盤塊while (fatitem.item != -1)item = fatitem.item; /查找該文件的下一盤塊/計算出該文件的最末地址first = fdisk + item*DISKSIZE + u_opentable.openitemfd.size%DISKSIZE;/如果最
47、后磁盤塊剩余的大小大于要寫入的文件的大小if (DISKSIZE - u_opentable.openitemfd.size%DISKSIZE>len)strcpy(first, buf);u_opentable.openitemfd.size = u_opentable.openitemfd.size + len;cur_dir->directitemtemp.size = cur_dir->directitemtemp.size + len;elsefor (i = 0; i<(DISKSIZE - u_opentable.openitemfd.size%DISKS
48、IZE); i+)/寫一部分內(nèi)容到最后一塊磁盤塊的剩余空間(字節(jié))firsti = bufi;/計算分配完最后一塊磁盤的剩余空間(字節(jié)) 還剩下多少字節(jié)未存儲ilen1 = len - (DISKSIZE - u_opentable.openitemfd.size%DISKSIZE);ilen2 = ilen1 / DISKSIZE;modlen = ilen1%DISKSIZE;if (modlen>0)ilen2 = ilen2 + 1; /還需要多少塊磁盤塊for (j = 0; j<ilen2; j+)for (i = ROOT_DISK_NO + 1; i<DISK
49、_NUM; i+)/尋找空閑磁盤塊if (fati.em_disk = '0')break;if (i >= DISK_NUM) /如果磁盤塊已經(jīng)分配完了return(-1);first = fdisk + i*DISKSIZE; /找到的那塊空閑磁盤塊的起始地址if (j = ilen2 - 1) /如果是最后要分配的一塊for (k = 0; k<len - (DISKSIZE - u_opentable.openitemfd.size%DISKSIZE) - j*DISKSIZE; k+)firstk = bufk;else/如果不是要最后分配的一塊for (
50、k = 0; k<DISKSIZE; k+)firstk = bufk;fatitem.item = i; /找到一塊后將它的序號存放在上一塊的指針中fati.em_disk = '1' /置找到的磁盤快的空閑標志位為已分配fati.item = -1; /它的指針為-1 (即沒有下一塊)/修改長度u_opentable.openitemfd.size = u_opentable.openitemfd.size + len;cur_dir->directitemtemp.size = cur_dir->directitemtemp.size + len;return 0;int read(int fd, char *buf)int len = u_opentable.openitemfd.size;char *first;int i, j, item;int ilen1, modlen;item = u_opentable.openitemfd.firstdisk;ilen1 = len / DISKSIZE;modlen = len%DISKSIZE;if (modlen != 0)ilen1
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 新版華東師大版八年級數(shù)學(xué)下冊《16.1.2分式的基本性質(zhì)通分》聽評課記錄3
- 五年級數(shù)學(xué)下冊聽評課記錄《3.1 分數(shù)乘法(一)》(3)-北師大版
- 2025年自返式取樣器合作協(xié)議書
- 蘇科版七年級數(shù)學(xué)上冊《2.6.2有理數(shù)的乘法與除法》聽評課記錄
- 小學(xué)二年級數(shù)學(xué)口算題大全
- 七年級上冊歷史第10課《秦末農(nóng)民大起義》聽課評課記錄
- 五年級下冊口算練習(xí)
- 人教版數(shù)學(xué)八年級下冊《一次函數(shù)的概念》聽評課記錄1
- 白酒銷售工作計劃書范本
- 聚合支付渠道服務(wù)協(xié)議書范本
- 2025年汽車加氣站作業(yè)人員安全全國考試題庫(含答案)
- 化工過程安全管理導(dǎo)則安全儀表管理課件
- 高三日語一輪復(fù)習(xí)日語助詞「に」和「を」的全部用法課件
- 【化學(xué)】高中化學(xué)手寫筆記
- 中國高血壓防治指南-解讀全篇
- 2024年監(jiān)控安裝合同范文6篇
- 2024年山東省高考政治試卷真題(含答案逐題解析)
- 煙葉復(fù)烤能源管理
- 食品安全管理員考試題庫298題(含標準答案)
- 執(zhí)業(yè)醫(yī)師資格考試《臨床執(zhí)業(yè)醫(yī)師》 考前 押題試卷絕密1 答案
- 非ST段抬高型急性冠脈綜合征診斷和治療指南(2024)解讀
評論
0/150
提交評論