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

正文內(nèi)容

操作系統(tǒng)課設(shè)報告-資料下載頁

2025-03-23 08:34本頁面
  

【正文】 rentPath=C:\\。 //當(dāng)前路徑 osPointformat()。//打開文件列表初始化 delete openlist。 openlist=new OPENLIST。 /*保存到磁盤上myfiles*/ fp = fopen(FilePath,w+)。 fwrite(BaseAddr,sizeof(char),DiskSize,fp)。 fclose(fp)。 printf(格式化成功??!\n)。 return 1。}int mkdir(char *sonfname)/*創(chuàng)建子目錄*/{//判斷是否有重名尋找空白子目錄項尋找空白盤塊號當(dāng)前目錄下增加該子目錄項分配子目錄盤塊,并且初始化修改fat表 int i,temp,iFAT。 struct dirFile *dir。 //當(dāng)前目錄的指針 if(current == 2) // 根目錄 dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 /*為了避免該目錄下同名文件夾*/ for(i = 1。iBlockFcbCount。i++){ if(dirfcb[i].type==DIRECTORY amp。amp。 strcmp(dirfcb[i].fname,sonfname)==0 ){ printf(該文件夾下已經(jīng)有同名的文件夾存在了!\n)。 return 0。 } } for(i = 1。i BlockFcbCount。 i++){//查找空白fcb序號 if(dirfcb[i].type==Zero) break。 } if(i == BlockFcbCount){ printf(該目錄已滿!請選擇新的目錄下創(chuàng)建!\n)。 return 0。 } temp = i。 for(i = 3。i BlockCount。i++) { if(osPointFAT1[i] == 0) break。 } if(i == BlockCount){ printf(磁盤已滿!\n)。 return 0。 } iFAT=i。 /*接下來進(jìn)行分配*/ osPointFAT1[iFAT]=osPointFAT2[iFAT] = 2。 //2表示分配給下級目錄文件 //填寫該分派新的盤塊的參數(shù) strcpy(dirfcb[temp].fname,sonfname)。 dirfcb[temp].type=DIRECTORY。 dirfcb[temp].fatherBlockNum=current。 dirfcb[temp].currentBlockNum=iFAT。 //初始化子目錄文件盤塊 dir=(struct dirFile*)(osPointdata [iFAT3])。 //定位到子目錄盤塊號 dirinit (current,iFAT,sonfname)。//iFAT是要分配的塊號,這里的current用來指要分配的塊的父塊號 printf(創(chuàng)建子目錄成功!\n)。 return 1。}int rmdir(char *sonfname)/*刪除當(dāng)前目錄下的文件夾*/{ int i,temp,j。//確保當(dāng)前目錄下有該文件,并記錄下該FCB下標(biāo) struct dirFile *dir。 //當(dāng)前目錄的指針 if(current==2) dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 for(i=1。iBlockFcbCount。i++){ //查找該目錄文件 if(dirfcb[i].type==DIRECTORY amp。amp。 strcmp(dirfcb[i].fname,sonfname)==0){ break。 } } temp=i。 if(i==BlockFcbCount){ printf(當(dāng)前目錄下不存在該子目錄!\n)。 return 0。 } j = dirfcb[temp].currentBlockNum。 struct dirFile *sonDir。 //當(dāng)前子目錄的指針 sonDir=(struct dirFile *)(osPointdata [ j 3])。 for(i=1。iBlockFcbCount。i++) { //查找子目錄是否為空目錄 if(sonDirfcb[i].type!=Zero) { printf(該文件夾為非空文件夾,為確保安全,請清空后再刪除!\n)。 return 0。 } } /*開始刪除子目錄操作*/ osPointFAT1[j] = osPointFAT2[j]=0。 //fat清空 char *p=osPointdata[j3]。 //格式化子目錄 memset(p,0,BlockSize)。 dirfcb[temp].initialize()。 //回收子目錄占據(jù)目錄項 printf(刪除當(dāng)前目錄下的文件夾成功\n)。 return 1。}/*在當(dāng)前目錄下創(chuàng)建文本文件*/int create(char *name){ int i,iFAT。//temp, int emptyNum = 0,isFound = 0。 //空閑目錄項個數(shù) struct dirFile *dir。 //當(dāng)前目錄的指針 if(current==2) dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 for(i=1。iBlockFcbCount。i++)//查看目錄是否已滿//為了避免同名的文本文件 { if(dirfcb[i].type == Zero amp。amp。 isFound == 0) { emptyNum = i。 isFound = 1。 } else if(dirfcb[i].type==GENERAL amp。amp。 strcmp(dirfcb[i].fname,name)==0 ){ printf(無法在同一目錄下創(chuàng)建同名文件!\n)。 return 0。 } } if(emptyNum == 0){ printf(已經(jīng)達(dá)到目錄項容納上限,無法創(chuàng)建新目錄!\n)。 return 0。 } for(i = 3。iBlockCount。i++)//查找FAT表尋找空白區(qū),用來分配磁盤塊號j { if(osPointFAT1[i]==0) break。 } if(i==BlockCount){ printf(磁盤已滿!\n)。 return 0。 } iFAT=i。 /*進(jìn)入分配階段*///分配磁盤塊 osPointFAT1[iFAT] = osPointFAT2[iFAT] = 1。 /*接下來進(jìn)行分配*///填寫該分派新的盤塊的參數(shù) strcpy(dirfcb[emptyNum].fname,name)。 dirfcb[emptyNum].type=GENERAL。 dirfcb[emptyNum].fatherBlockNum=current。 dirfcb[emptyNum].currentBlockNum=iFAT。 dirfcb[emptyNum].size =0。 char* p = osPointdata[iFAT 3]。 memset(p,4,BlockSize)。 printf(在當(dāng)前目錄下創(chuàng)建文本文件成功!\n)。 return 1。}/*查詢子目錄*/int listshow(){ int i,DirCount=0,FileCount=0。 //搜索當(dāng)前目錄 struct dirFile *dir。 //當(dāng)前目錄的指針 if(current==2) dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 for(i=1。iBlockFcbCount。i++) { if(dirfcb[i].type==GENERAL){ //查找普通文件 FileCount++。 printf(%s 文本文件.\n,dirfcb[i].fname)。 } if(dirfcb[i].type==DIRECTORY){ //查找目錄文件 DirCount++。 printf(%s 文件夾.\n,dirfcb[i].fname)。 } } printf(\n該目錄下共有 %d 個文本文件, %d 個文件夾\n\n,FileCount,DirCount)。 return 1。}/*在當(dāng)前目錄下刪除文件*/int delfile(char *name){ int i,temp,j。 //確保當(dāng)前目錄下有該文件,并且記錄下它的FCB下標(biāo) struct dirFile *dir。 //當(dāng)前目錄的指針 if(current == 2) dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 for(i=1。i BlockFcbCount。i++) //查找該文件 { if(dirfcb[i].type==GENERAL amp。amp。 strcmp(dirfcb[i].fname,name)==0){ break。 } } if(i == BlockFcbCount){ printf(當(dāng)前目錄下不存在該文件!\n)。 return 0。 } int k。 for(k=0。kOPEN_MAX。k++){ if((openlistf [k].type = GENERAL)amp。amp。 (strcmp(openlistf [k].fname,name)==0)){ if(openlistf[k].fatherBlockNum == current){ break。 } else{ printf(該文件未在當(dāng)前目錄下!\n)。 return 0。 } } } if(k!=OPEN_MAX){ close(name)。 } //從打開列表中刪除 /*開始刪除文件操作*/ temp=i。 j = dirfcb [temp].currentBlockNum 。 //查找盤塊號j osPointFAT1[j]=osPointFAT2[j]=0。 //fat1,fat2表標(biāo)記為空白 char *p=osPointdata[j 3]。 memset(p,0,BlockSize)。 //清除原文本文件的內(nèi)容 dirfcb[temp].initialize()。 //type=0。 //標(biāo)記該目錄項為空文件 printf(在當(dāng)前目錄下刪除文件成功!\n)。 return 1。}/*進(jìn)入當(dāng)前目錄下的子目錄*/int changePath(char *sonfname){ struct dirFile *dir。 //當(dāng)前目錄的指針 if(current==2) dir=amp。(osPointroot)。 else dir=(struct dirFile *)(osPointdata [current3])。 /*回到父目錄*/ if(strcmp(sonfname,..)==0){ if(current==2){ printf(你現(xiàn)已經(jīng)在根目錄下!\n)。 return 0。 } current = dirfcb[0].fatherBlockNum 。 currentPath = (0,() strlen(dirfcb[0].fname )1)。 return 1。 } /*進(jìn)入子目錄*///確保當(dāng)前目錄下有該目錄,并且記錄下它的FCB下標(biāo) int i,temp。 for(i = 1。 i Block
點擊復(fù)制文檔內(nèi)容
范文總結(jié)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1