10101010错误信息文件魔数什么意思

豆丁微信公众号
君,已阅读到文档的结尾了呢~~
操作系统文件件系统系统,文件,帮助,操作系统,文件系统,系统文件,文件夹,文 件
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
操作系统文件件系统
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='http://www.docin.com/DocinViewer--144.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口【操作系统】C语言编写的FAT16文件系统
这是操作系统的期末课程设计作业之一,主要功能是在物理内存中虚拟出一个1M大小的FAT16的文件系统,然后把它读入内存中,进行具体的文件操作,具体的实用性不大,主要目的是为了练习C语言,帮助理解文件系统的特点,代码如下:
#include&&stdio.h&&&
#include&&malloc.h&&&
#include&&string.h&&&
#include&&time.h&&&
#define&BLOCKSIZE&1024&&//&磁盘块大小&&
#define&SIZE&1024000&&//&虚拟磁盘空间大小&&
#define&END&65535&&//&FAT中的文件结束标志&&
#define&FREE&0&&//&FAT中盘块空闲标志&&
#define&ROOTBLOCKNUM&2&&//&根目录区所占盘块数&&
#define&MAXOPENFILE&10&&//&最多同时打开文件个数t&&
#define&MAXTEXT&10000&&
typedef&struct&FCB&&
&&&&char&filename[8];&&
&&&&char&exname[3];&&
&&&&unsigned&char&&&
&&&&unsigned&short&&&
&&&&unsigned&short&&&
&&&&unsigned&short&&&
&&&&unsigned&long&&&
&&&&char&&&
typedef&struct&FAT&&
&&&&unsigned&short&&&
typedef&struct&USEROPEN&&
&&&&char&filename[8];&&
&&&&char&exname[3];&&
&&&&unsigned&char&&&
&&&&unsigned&short&&&
&&&&unsigned&short&&&
&&&&unsigned&short&&&
&&&&unsigned&long&&&
&&&&char&&&
&&&&unsigned&short&&&
&&&&int&&&
&&&&char&dir[80];&&
&&&&int&&&
&&&&int&&&
&&&&char&&&
&&&&char&&&
typedef&struct&BLOCK0&&
&&&&char&magic[10];&&
&&&&char&information[200];&&
&&&&unsigned&short&&&
&&&&unsigned&char&*&&
}block0;&&
unsigned&char&*&&
useropen&openfilelist[MAXOPENFILE];&&
char&currentdir[80];&&
unsigned&char*&&&
char&myfilename[]&=&"myfilesys";
void&startsys();&&
void&my_format();&&
void&my_cd(char&*dirname);&&
void&my_mkdir(char&*dirname);&&
void&my_rmdir(char&*dirname);&&
void&my_ls();&&
void&my_create&(char&*filename);&&
void&my_rm(char&*filename);&&
int&my_open(char&*filename);&&
int&my_close(int&fd);&&
int&my_write(int&fd);&&
int&do_write(int&fd,&char&*text,&int&len,&char&wstyle);&&
int&my_read&(int&fd,&int&len);&&
int&do_read&(int&fd,&int&len,char&*text);&&
void&my_exitsys();&&
unsigned&short&findblock();&&
int&findopenfile();&&
void&startsys()&&
&&&&FILE&*&&
&&&&unsigned&char&buf[SIZE];&&
&&&&fcb&*&&
&&&&int&i;&&
&&&&myvhard&=&(unsigned&char&*)malloc(SIZE);
&&&&memset(myvhard,&0,&SIZE);
&&&&if((fp&=&fopen(myfilename,&"r"))&!=&NULL)&&
&&&&&&&&fread(buf,&SIZE,&1,&fp);
&&&&&&&&fclose(fp);
&&&&&&&&if(strcmp(((block0&*)buf)-&magic,&""))
&&&&&&&&{&&
&&&&&&&&&&&&printf("myfilesys&is&not&exist,begin&to&creat&the&file...\n");&&
&&&&&&&&&&&&my_format();&&
&&&&&&&&}&&
&&&&&&&&else&&
&&&&&&&&{&&
&&&&&&&&&&&&for(i&=&0;&i&&&SIZE;&i++)&&
&&&&&&&&&&&&&&&&myvhard[i]&=&buf[i];&&
&&&&&&&&}&&
&&&&else&&
&&&&&&&&printf("myfilesys&is&not&exist,begin&to&creat&the&file...\n");&&
&&&&&&&&my_format();&&
&&&&root&=&(fcb&*)(myvhard&+&5&*&BLOCKSIZE);&&
&&&&strcpy(openfilelist[0].filename,&root-&filename);&&
&&&&strcpy(openfilelist[0].exname,&root-&exname);&&
&&&&openfilelist[0].attribute&=&root-&&&
&&&&openfilelist[0].time&=&root-&&&
&&&&openfilelist[0].date&=&root-&&&
&&&&openfilelist[0].first&=&root-&&&
&&&&openfilelist[0].length&=&root-&&&
&&&&openfilelist[0].free&=&root-&&&
&&&&openfilelist[0].dirno&=&5;&&
&&&&openfilelist[0].diroff&=&0;&&
&&&&strcpy(openfilelist[0].dir,&"\\root\\");&&
&&&&openfilelist[0].father&=&0;&&
&&&&openfilelist[0].count&=&0;&&
&&&&openfilelist[0].fcbstate&=&0;&&
&&&&openfilelist[0].topenfile&=&1;&&
&&&&for(i&=&1;&i&&&MAXOPENFILE;&i++)&&
&&&&&&&&openfilelist[i].topenfile&=&0;&&
&&&&curdir&=&0;&&
&&&&strcpy(currentdir,&"\\root\\");&&
&&&&startp&=&((block0&*)myvhard)-&&&
void&my_format()&&
&&&&FILE&*&&
&&&&fat&*fat1,&*fat2;&&
&&&&block0&*blk0;&&
&&&&time_t&&&
&&&&struct&tm&*&&
&&&&fcb&*&&
&&&&int&i;&&
&&&&blk0&=&(block0&*)&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&root&=&(fcb&*)(myvhard&+&5&*&BLOCKSIZE);&&
&&&&strcpy(blk0-&magic,&"");&&
&&&&strcpy(blk0-&information,&"My&FileSystem&Ver&1.0&\n&Blocksize=1KB&Whole&size=1000KB&Blocknum=1000&RootBlocknum=2\n");&&
&&&&blk0-&root&=&5;&&
&&&&blk0-&startblock&=&(unsigned&char&*)&&
&&&&for(i&=&0;&i&&&5;&i++)&&
&&&&&&&&fat1-&id&=&END;&&
&&&&&&&&fat2-&id&=&END;&&
&&&&&&&&fat1++;&&
&&&&&&&&fat2++;&&
&&&&fat1-&id&=&6;&&
&&&&fat2-&id&=&6;&&
&&&&fat1++;&&
&&&&fat2++;&&
&&&&fat1-&id&=&END;&&
&&&&fat2-&id&=&END;&&
&&&&fat1++;&&
&&&&fat2++;&&
&&&&for(i&=&7;&i&&&SIZE&/&BLOCKSIZE;&i++)&&
&&&&&&&&fat1-&id&=&FREE;&&
&&&&&&&&fat2-&id&=&FREE;&&
&&&&&&&&fat1++;&&
&&&&&&&&fat2++;&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(root-&filename,&".");&&
&&&&strcpy(root-&exname,&"");&&
&&&&root-&attribute&=&0x28;&&
&&&&root-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&root-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&root-&first&=&5;&&
&&&&root-&length&=&2&*&sizeof(fcb);&&
&&&&root-&free&=&1;&&
&&&&root++;&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(root-&filename,&"..");&&
&&&&strcpy(root-&exname,&"");&&
&&&&root-&attribute&=&0x28;&&
&&&&root-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&root-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&root-&first&=&5;&&
&&&&root-&length&=&2&*&sizeof(fcb);&&
&&&&root-&free&=&1;&&
&&&&fp&=&fopen(myfilename,&"w");&&
&&&&fwrite(myvhard,&SIZE,&1,&fp);&&
&&&&fclose(fp);&&
void&my_cd(char&*dirname)&&
&&&&char&*&&
&&&&int&&&
&&&&dir&=&strtok(dirname,&"\\");//分解字符串为一组字符串。dirname为要分解的字符串,"\\"为分隔符字符串&&
&&&&if(strcmp(dir,&".")&==&0)&&
&&&&&&&&&&
&&&&else&if(strcmp(dir,&"..")&==&0)&&
&&&&&&&&if(curdir)&&
&&&&&&&&&&&&curdir&=&my_close(curdir);&&
&&&&&&&&&&
&&&&else&if(strcmp(dir,&"root")&==&0)&&
&&&&&&&&while(curdir)&&
&&&&&&&&&&&&curdir&=&my_close(curdir);&&
&&&&&&&&dir&=&strtok(NULL,&"\\");&&
&&&&while(dir)&&
&&&&&&&&fd&=&my_open(dir);&&
&&&&&&&&if(fd&!=&-1)&&
&&&&&&&&&&&&curdir&=&&&
&&&&&&&&else&&
&&&&&&&&&&&&&&
&&&&&&&&dir&=&strtok(NULL,&"\\");&&
void&my_mkdir(char&*dirname)&&
&&&&fcb&*&&
&&&&fat&*fat1,&*fat2;&&
&&&&time_t&&&
&&&&struct&tm&*&&
&&&&char&text[MAXTEXT];&&
&&&&unsigned&short&&&
&&&&int&rbn,&fd,&i;&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)
&&&&&&&&if(strcmp(fcbptr-&filename,&dirname)&==&0&&&&strcmp(fcbptr-&exname,&"")&==&0)&&
&&&&&&&&{&&
&&&&&&&&&&&&printf("Error,the&dirname&is&already&exist!\n");&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&fcbptr++;&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(fcbptr-&free&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&blkno&=&findblock();
&&&&if(blkno&==&-1)&&
&&&&&&&&&&
&&&&(fat1&+&blkno)-&id&=&END;&&
&&&&(fat2&+&blkno)-&id&=&END;&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(fcbptr-&filename,&dirname);&&
&&&&strcpy(fcbptr-&exname,&"");&&
&&&&fcbptr-&attribute&=&0x30;&&
&&&&fcbptr-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&fcbptr-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&fcbptr-&first&=&&&
&&&&fcbptr-&length&=&2&*&sizeof(fcb);&&
&&&&fcbptr-&free&=&1;&&
&&&&openfilelist[curdir].count&=&i&*&sizeof(fcb);&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&fd&=&my_open(dirname);
&&&&if(fd&==&-1)&&
&&&&&&&&&&
&&&&fcbptr&=&(fcb&*)malloc(sizeof(fcb));&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(fcbptr-&filename,&".");&&
&&&&strcpy(fcbptr-&exname,&"");&&
&&&&fcbptr-&attribute&=&0x28;&&
&&&&fcbptr-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&fcbptr-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&fcbptr-&first&=&&&
&&&&fcbptr-&length&=&2&*&sizeof(fcb);&&
&&&&fcbptr-&free&=&1;&&
&&&&do_write(fd,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(fcbptr-&filename,&"..");&&
&&&&strcpy(fcbptr-&exname,&"");&&
&&&&fcbptr-&attribute&=&0x28;&&
&&&&fcbptr-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&fcbptr-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&fcbptr-&first&=&&&
&&&&fcbptr-&length&=&2&*&sizeof(fcb);&&
&&&&fcbptr-&free&=&1;&&
&&&&do_write(fd,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&free(fcbptr);&&
&&&&my_close(fd);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&fcbptr-&length&=&openfilelist[curdir].&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&openfilelist[curdir].fcbstate&=&1;&&
void&my_rmdir(char&*dirname)&&
&&&&fcb&*fcbptr,*fcbptr2;&&
&&&&fat&*fat1,&*fat2,&*fatptr1,&*fatptr2;&&
&&&&char&text[MAXTEXT],&text2[MAXTEXT];&&
&&&&unsigned&short&&&
&&&&int&rbn,&rbn2,&fd,&i,&j;&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&if(strcmp(dirname,&".")&==&0&||&strcmp(dirname,&"..")&==&0)&&
&&&&&&&&printf("Error,can't&remove&this&directory.\n");&&
&&&&&&&&&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)
&&&&&&&&if(strcmp(fcbptr-&filename,&dirname)&==&0&&&&strcmp(fcbptr-&exname,&"")&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&if(i&==&rbn&/&sizeof(fcb))&&
&&&&&&&&printf("Error,the&directory&is&not&exist.\n");&&
&&&&&&&&&&
&&&&fd&=&my_open(dirname);&&
&&&&rbn2&=&do_read(fd,&openfilelist[fd].length,&text2);&&
&&&&fcbptr2&=&(fcb&*)text2;&&
&&&&for(j&=&0;&j&&&rbn2&/&sizeof(fcb);&j++)
&&&&&&&&if(strcmp(fcbptr2-&filename,&".")&&&&strcmp(fcbptr2-&filename,&"..")&&&&strcmp(fcbptr2-&filename,&""))&&
&&&&&&&&{&&
&&&&&&&&&&&&my_close(fd);&&
&&&&&&&&&&&&printf("Error,the&directory&is&not&empty.\n");&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&fcbptr2++;&&
&&&&blkno&=&openfilelist[fd].&&
&&&&while(blkno&!=&END)&&
&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&fatptr1-&id&=&FREE;&&
&&&&&&&&fatptr2-&id&=&FREE;&&
&&&&my_close(fd);&&
&&&&strcpy(fcbptr-&filename,&"");&&
&&&&fcbptr-&free&=&0;&&
&&&&openfilelist[curdir].count&=&i&*&sizeof(fcb);&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&openfilelist[curdir].fcbstate&=&1;&&
void&my_ls()&&
&&&&fcb&*&&
&&&&char&text[MAXTEXT];&&
&&&&int&rbn,&i;&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(fcbptr-&free)&&
&&&&&&&&{&&
&&&&&&&&&&&&if(fcbptr-&attribute&&&0x20)&&
&&&&&&&&&&&&&&&&printf("%s\\\t\t&DIR&\t\t%d/%d/%d\t%02d:%02d:%02d\n",&fcbptr-&filename,&(fcbptr-&date&&&&9)&+&1980,&(fcbptr-&date&&&&5)&&&0x000f,&fcbptr-&date&&&0x001f,&fcbptr-&time&&&&11,&(fcbptr-&time&&&&5)&&&0x003f,&fcbptr-&time&&&0x001f&*&2);&&
&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&printf("%s.%s\t\t%dB\t\t%d/%d/%d\t%02d:%02d:%02d\t\n",&fcbptr-&filename,&fcbptr-&exname,&(int)(fcbptr-&length),&(fcbptr-&date&&&&9)&+&1980,&(fcbptr-&date&&&&5)&&&0x000f,&fcbptr-&date&&&0x1f,&fcbptr-&time&&&&11,&(fcbptr-&time&&&&5)&&&0x3f,&fcbptr-&time&&&0x1f&*&2);&&
&&&&&&&&}&&
&&&&&&&&fcbptr++;&&
void&my_create(char&*filename)&&
&&&&fcb&*&&
&&&&fat&*fat1,&*fat2;&&
&&&&char&*fname,&*exname,&text[MAXTEXT];&&
&&&&unsigned&short&&&
&&&&int&rbn,&i;&&
&&&&time_t&&&
&&&&struct&tm&*&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fname&=&strtok(filename,&".");&&
&&&&exname&=&strtok(NULL,&".");&&
&&&&if(strcmp(fname,&"")&==&0)&&
&&&&&&&&printf("Error,creating&file&must&have&a&right&name.\n");&&
&&&&&&&&&&
&&&&if(!exname)&&
&&&&&&&&printf("Error,creating&file&must&have&a&extern&name.\n");&&
&&&&&&&&&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(strcmp(fcbptr-&filename,&fname)&==&0&&&&strcmp(fcbptr-&exname,&exname)&==&0)&&
&&&&&&&&{&&
&&&&&&&&&&&&printf("Error,the&filename&is&already&exist!\n");&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&fcbptr++;&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(fcbptr-&free&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&blkno&=&findblock();&&
&&&&if(blkno&==&-1)&&
&&&&&&&&&&
&&&&(fat1&+&blkno)-&id&=&END;&&
&&&&(fat2&+&blkno)-&id&=&END;&&
&&&&now&=&time(NULL);&&
&&&&nowtime&=&localtime(&now);&&
&&&&strcpy(fcbptr-&filename,&fname);&&
&&&&strcpy(fcbptr-&exname,&exname);&&
&&&&fcbptr-&attribute&=&0x00;&&
&&&&fcbptr-&time&=&nowtime-&tm_hour&*&2048&+&nowtime-&tm_min&*&32&+&nowtime-&tm_sec&/&2;&&
&&&&fcbptr-&date&=&(nowtime-&tm_year&-&80)&*&512&+&(nowtime-&tm_mon&+&1)&*&32&+&nowtime-&tm_&&
&&&&fcbptr-&first&=&&&
&&&&fcbptr-&length&=&0;&&
&&&&fcbptr-&free&=&1;&&
&&&&openfilelist[curdir].count&=&i&*&sizeof(fcb);&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&fcbptr-&length&=&openfilelist[curdir].&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&openfilelist[curdir].fcbstate&=&1;&&
void&my_rm(char&*filename)&&
&&&&fcb&*&&
&&&&fat&*fat1,&*fat2,&*fatptr1,&*fatptr2;&&
&&&&char&*fname,&*exname,&text[MAXTEXT];&&
&&&&unsigned&short&&&
&&&&int&rbn,&i;&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&fname&=&strtok(filename,&".");&&
&&&&exname&=&strtok(NULL,&".");&&
&&&&if(strcmp(fname,&"")&==&0)&&
&&&&&&&&printf("Error,removing&file&must&have&a&right&name.\n");&&
&&&&&&&&&&
&&&&if(!exname)&&
&&&&&&&&printf("Error,removing&file&must&have&a&extern&name.\n");&&
&&&&&&&&&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(strcmp(fcbptr-&filename,&fname)&==&0&&&&strcmp(fcbptr-&exname,&exname)&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&if(i&==&rbn&/&sizeof(fcb))&&
&&&&&&&&printf("Error,the&file&is&not&exist.\n");&&
&&&&&&&&&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(strcmp(fcbptr-&filename,&fname)&==&0&&&&strcmp(fcbptr-&exname,&exname)&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&if(i&==&rbn&/&sizeof(fcb))&&
&&&&&&&&printf("Error,the&file&is&not&exist.\n");&&
&&&&&&&&&&
&&&&blkno&=&fcbptr-&&&
&&&&while(blkno&!=&END)&&
&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&fatptr1-&id&=&FREE;&&
&&&&&&&&fatptr2-&id&=&FREE;&&
&&&&strcpy(fcbptr-&filename,&"");&&
&&&&fcbptr-&free&=&0;&&
&&&&openfilelist[curdir].count&=&i&*&sizeof(fcb);&&
&&&&do_write(curdir,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&openfilelist[curdir].fcbstate&=&1;&&
int&my_open(char&*filename)&&
&&&&fcb&*&&
&&&&char&*fname,&exname[3],&*str,&text[MAXTEXT];&&
&&&&int&rbn,&fd,&i;&&
&&&&fname&=&strtok(filename,&".");&&
&&&&str&=&strtok(NULL,&".");&&
&&&&if(str)&&
&&&&&&&&strcpy(exname,&str);&&
&&&&else&&
&&&&&&&&strcpy(exname,&"");&&
&&&&for(i&=&0;&i&&&MAXOPENFILE;&i++)&&
&&&&&&&&if(strcmp(openfilelist[i].filename,&fname)&==&0&&&&strcmp(openfilelist[i].exname,&exname)&==&0&&&&i&!=&curdir)&&
&&&&&&&&{&&
&&&&&&&&&&&&printf("Error,the&file&is&already&open.\n");&&
&&&&&&&&&&&&return&-1;&&
&&&&&&&&}&&
&&&&openfilelist[curdir].count&=&0;&&
&&&&rbn&=&do_read(curdir,&openfilelist[curdir].length,&text);&&
&&&&fcbptr&=&(fcb&*)&&
&&&&for(i&=&0;&i&&&rbn&/&sizeof(fcb);&i++)&&
&&&&&&&&if(strcmp(fcbptr-&filename,&fname)&==&0&&&&strcmp(fcbptr-&exname,&exname)&==&0)&&
&&&&&&&&&&&&&&
&&&&&&&&fcbptr++;&&
&&&&if(i&==&rbn&/&sizeof(fcb))&&
&&&&&&&&printf("Error,the&file&is&not&exist.\n");&&
&&&&&&&&return&-1;&&
&&&&fd&=&findopenfile();&&
&&&&if(fd&==&-1)&&
&&&&&&&&return&-1;&&
&&&&strcpy(openfilelist[fd].filename,&fcbptr-&filename);&&
&&&&strcpy(openfilelist[fd].exname,&fcbptr-&exname);&&
&&&&openfilelist[fd].attribute&=&fcbptr-&&&
&&&&openfilelist[fd].time&=&fcbptr-&&&
&&&&openfilelist[fd].date&=&fcbptr-&&&
&&&&openfilelist[fd].first&=&fcbptr-&&&
&&&&openfilelist[fd].length&=&fcbptr-&&&
&&&&openfilelist[fd].free&=&fcbptr-&&&
&&&&openfilelist[fd].dirno&=&openfilelist[curdir].&&
&&&&openfilelist[fd].diroff&=&i;&&
&&&&strcpy(openfilelist[fd].dir,&openfilelist[curdir].dir);&&
&&&&strcat(openfilelist[fd].dir,&filename);&&
&&&&if(fcbptr-&attribute&&&0x20)&&
&&&&&&&&strcat(openfilelist[fd].dir,&"\\");&&
&&&&openfilelist[fd].father&=&&&
&&&&openfilelist[fd].count&=&0;&&
&&&&openfilelist[fd].fcbstate&=&0;&&
&&&&openfilelist[fd].topenfile&=&1;&&
&&&&return&&&
int&my_close(int&fd)&&
&&&&fcb&*&&
&&&&int&&&
&&&&if(fd&&&0&||&fd&&=&MAXOPENFILE)&&
&&&&&&&&printf("Error,the&file&is&not&exist.\n");&&
&&&&&&&&return&-1;&&
&&&&if(openfilelist[fd].fcbstate)&&
&&&&&&&&fcbptr&=&(fcb&*)malloc(sizeof(fcb));&&
&&&&&&&&strcpy(fcbptr-&filename,&openfilelist[fd].filename);&&
&&&&&&&&strcpy(fcbptr-&exname,&openfilelist[fd].exname);&&
&&&&&&&&fcbptr-&attribute&=&openfilelist[fd].&&
&&&&&&&&fcbptr-&time&=&openfilelist[fd].&&
&&&&&&&&fcbptr-&date&=&openfilelist[fd].&&
&&&&&&&&fcbptr-&first&=&openfilelist[fd].&&
&&&&&&&&fcbptr-&length&=&openfilelist[fd].&&
&&&&&&&&fcbptr-&free&=&openfilelist[fd].&&
&&&&&&&&father&=&openfilelist[fd].&&
&&&&&&&&openfilelist[father].count&=&openfilelist[fd].diroff&*&sizeof(fcb);&&
&&&&&&&&do_write(father,&(char&*)fcbptr,&sizeof(fcb),&2);&&
&&&&&&&&free(fcbptr);&&
&&&&&&&&openfilelist[fd].fcbstate&=&0;&&
&&&&strcpy(openfilelist[fd].filename,&"");&&
&&&&strcpy(openfilelist[fd].exname,&"");&&
&&&&openfilelist[fd].topenfile&=&0;&&
&&&&return&&&
int&my_write(int&fd)&&
&&&&fat&*fat1,&*fat2,&*fatptr1,&*fatptr2;&&
&&&&int&wstyle,&len,&ll,&&&
&&&&char&text[MAXTEXT];&&
&&&&unsigned&short&&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&if(fd&&&0&||&fd&&=&MAXOPENFILE)&&
&&&&&&&&printf("The&file&is&not&exist!\n");&&
&&&&&&&&return&-1;&&
&&&&while(1)&&
&&&&&&&&printf("Please&enter&the&number&of&write&style:\n1.cut&write\t2.cover&write\t3.add&write\n");&&
&&&&&&&&scanf("%d",&&wstyle);&&
&&&&&&&&if(wstyle&&&0&&&&wstyle&&&4)&&
&&&&&&&&&&&&&&
&&&&&&&&printf("Input&Error!");&&
&&&&getchar();&&
&&&&switch(wstyle)&&
&&&&&&&&case&1:&&
&&&&&&&&&&&&blkno&=&openfilelist[fd].&&
&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&&&&&fatptr1-&id&=&END;&&
&&&&&&&&&&&&fatptr2-&id&=&END;&&
&&&&&&&&&&&&while(blkno&!=&END)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&&&&&&&&&fatptr1-&id&=&FREE;&&
&&&&&&&&&&&&&&&&fatptr2-&id&=&FREE;&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&openfilelist[fd].count&=&0;&&
&&&&&&&&&&&&openfilelist[fd].length&=&0;&&
&&&&&&&&&&&&&&
&&&&&&&&case&2:&&
&&&&&&&&&&&&openfilelist[fd].count&=&0;&&
&&&&&&&&&&&&&&
&&&&&&&&case&3:&&
&&&&&&&&&&&&openfilelist[fd].count&=&openfilelist[fd].&&
&&&&&&&&&&&&&&
&&&&&&&&default:&&
&&&&&&&&&&&&&&
&&&&ll&=&0;&&
&&&&printf("please&input&write&data(end&with&Ctrl+Z):\n");&&
&&&&while(gets(text))&&
&&&&&&&&len&=&strlen(text);&&
&&&&&&&&text[len++]&=&'\n';&&
&&&&&&&&text[len]&=&'\0';&&
&&&&&&&&tmp&=&do_write(fd,&text,&len,&wstyle);&&
&&&&&&&&if(tmp&!=&-1)&&
&&&&&&&&&&&&ll&+=&&&
&&&&&&&&if(tmp&&&len)&&
&&&&&&&&{&&
&&&&&&&&&&&&printf("Wirte&Error!");&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&return&&&
int&do_write(int&fd,&char&*text,&int&len,&char&wstyle)&&
&&&&fat&*fat1,&*fat2,&*fatptr1,&*fatptr2;&&
&&&&unsigned&char&*buf,&*&&
&&&&unsigned&short&blkno,&&&
&&&&int&i,&&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&fat2&=&(fat&*)(myvhard&+&3&*&BLOCKSIZE);&&
&&&&buf&=&(unsigned&char&*)malloc(BLOCKSIZE);&&
&&&&if(buf&==&NULL)&&
&&&&&&&&printf("malloc&failed!\n");&&
&&&&&&&&return&-1;&&
&&&&blkno&=&openfilelist[fd].&&
&&&&blkoff&=&openfilelist[fd].&&
&&&&fatptr1&=&fat1&+&&&
&&&&fatptr2&=&fat2&+&&&
&&&&while(blkoff&&=&BLOCKSIZE)&&
&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&if(blkno&==&END)&&
&&&&&&&&{&&
&&&&&&&&&&&&blkno&=&findblock();&&
&&&&&&&&&&&&if(blkno&==&-1)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&free(buf);&&
&&&&&&&&&&&&&&&&return&-1;&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&fatptr1-&id&=&&&
&&&&&&&&&&&&fatptr2-&id&=&&&
&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&&&&&fatptr1-&id&=&END;&&
&&&&&&&&&&&&fatptr2-&id&=&END;&&
&&&&&&&&}&&
&&&&&&&&else&&
&&&&&&&&{&&
&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&}&&
&&&&&&&&blkoff&=&blkoff&-&BLOCKSIZE;&&
&&&&ll&=&0;&&
&&&&while(ll&&&len)&&
&&&&&&&&blkptr&=&(unsigned&char&*)(myvhard&+&blkno&*&BLOCKSIZE);&&
&&&&&&&&for(i&=&0;&i&&&BLOCKSIZE;&i++)&&
&&&&&&&&&&&&buf[i]&=&blkptr[i];&&
&&&&&&&&for(;blkoff&&&BLOCKSIZE;&blkoff++)&&
&&&&&&&&{&&
&&&&&&&&&&&&buf[blkoff]&=&text[ll++];&&
&&&&&&&&&&&&openfilelist[fd].count++;&&
&&&&&&&&&&&&if(ll&==&len)&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&for(i&=&0;&i&&&BLOCKSIZE;&i++)&&
&&&&&&&&&&&&blkptr[i]&=&buf[i];&&
&&&&&&&&if(ll&&&len)&&
&&&&&&&&{&&
&&&&&&&&&&&&blkno&=&fatptr1-&&&
&&&&&&&&&&&&if(blkno&==&END)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&blkno&=&findblock();&&
&&&&&&&&&&&&&&&&if(blkno&==&-1)&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&fatptr1-&id&=&&&
&&&&&&&&&&&&&&&&fatptr2-&id&=&&&
&&&&&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&&&&&&&&&fatptr1-&id&=&END;&&
&&&&&&&&&&&&&&&&fatptr2-&id&=&END;&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&else&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&fatptr1&=&fat1&+&&&
&&&&&&&&&&&&&&&&fatptr2&=&fat2&+&&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&blkoff&=&0;&&
&&&&&&&&&&&&}&&
&&&&if(openfilelist[fd].count&&&openfilelist[fd].length)&&
&&&&&&&&openfilelist[fd].length&=&openfilelist[fd].&&
&&&&openfilelist[fd].fcbstate&=&1;&&
&&&&free(buf);&&
&&&&return&&&
int&my_read(int&fd,&int&len)&&
&&&&char&text[MAXTEXT];&&
&&&&int&&&
&&&&if(fd&&&0&||&fd&&=&MAXOPENFILE)&&
&&&&&&&&printf("The&File&is&not&exist!\n");&&
&&&&&&&&return&-1;&&
&&&&openfilelist[fd].count&=&0;&&
&&&&ll&=&do_read(fd,&len,&text);&&
&&&&if(ll&!=&-1)&&
&&&&&&&&printf("%s",&text);&&
&&&&else&&
&&&&&&&&printf("Read&Error!\n");&&
&&&&return&&&
int&do_read(int&fd,&int&len,&char&*text)&&
&&&&fat&*fat1,&*&&
&&&&unsigned&char&*buf,&*&&
&&&&unsigned&short&blkno,&&&
&&&&int&i,&&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&buf&=&(unsigned&char&*)malloc(BLOCKSIZE);&&
&&&&if(buf&==&NULL)&&
&&&&&&&&printf("malloc&failed!\n");&&
&&&&&&&&return&-1;&&
&&&&blkno&=&openfilelist[fd].&&
&&&&blkoff&=&openfilelist[fd].&&
&&&&if(blkoff&&=&openfilelist[fd].length)&&
&&&&&&&&puts("Read&out&of&range!");&&
&&&&&&&&free(buf);&&
&&&&&&&&return&-1;&&
&&&&fatptr&=&fat1&+&&&
&&&&while(blkoff&&=&BLOCKSIZE)&&
&&&&&&&&blkno&=&fatptr-&&&
&&&&&&&&blkoff&=&blkoff&-&BLOCKSIZE;&&
&&&&&&&&fatptr&=&fat1&+&&&
&&&&ll&=&0;&&
&&&&while(ll&&&len)&&
&&&&&&&&blkptr&=&(unsigned&char&*)(myvhard&+&blkno&*&BLOCKSIZE);&&
&&&&&&&&for(i&=&0;&i&&&BLOCKSIZE;&i++)&&
&&&&&&&&&&&&buf[i]&=&blkptr[i];&&
&&&&&&&&for(;&blkoff&&&BLOCKSIZE;&blkoff++)&&
&&&&&&&&{&&
&&&&&&&&&&&&text[ll++]&=&buf[blkoff];&&
&&&&&&&&&&&&openfilelist[fd].count++;&&
&&&&&&&&&&&&if(ll&==&len&||&openfilelist[fd].count&==&openfilelist[fd].length)&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&if(ll&&&len&&&&openfilelist[fd].count&!=&openfilelist[fd].length)&&
&&&&&&&&{&&
&&&&&&&&&&&&blkno&=&fatptr-&&&
&&&&&&&&&&&&if(blkno&==&END)&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&blkoff&=&0;&&
&&&&&&&&&&&&fatptr&=&fat1&+&&&
&&&&&&&&}&&
&&&&text[ll]&=&'\0';&&
&&&&free(buf);&&
&&&&return&&&
void&my_exitsys()&&
&&&&FILE&*&&
&&&&while(curdir)&&
&&&&&&&&curdir&=&my_close(curdir);&&
&&&&fp&=&fopen(myfilename,&"w");&&
&&&&fwrite(myvhard,&SIZE,&1,&fp);&&
&&&&fclose(fp);&&
&&&&free(myvhard);&&
unsigned&short&findblock()&&
&&&&unsigned&short&i;&&
&&&&fat&*fat1,&*&&
&&&&fat1&=&(fat&*)(myvhard&+&BLOCKSIZE);&&
&&&&for(i&=&7;&i&&&SIZE&/&BLOCKSIZE;&i++)&&
&&&&&&&&fatptr&=&fat1&+&i;&&
&&&&&&&&if(fatptr-&id&==&FREE)&&
&&&&&&&&&&&&return&i;&&
&&&&printf("Error,Can't&find&free&block!\n");&&
&&&&return&-1;&&
int&findopenfile()&&
&&&&int&i;&&
&&&&for(i&=&0;&i&&&MAXTEXT;&i++)&&
&&&&&&&&if(openfilelist[i].topenfile&==&0)&&
&&&&&&&&&&&&return&i;&&
&&&&printf("Error,open&too&many&files!\n");&&
&&&&return&-1;&&
int&main()&&
&&&&char&cmd[15][10]&=&{"cd",&"mkdir",&"rmdir",&"ls",&"create",&"rm",&"open",&"close",&"write",&"read",&"exit"};&&
&&&&char&s[30],&*&&
&&&&int&cmdn,&flag&=&1,&i;&&
&&&&startsys();&&
&&&&printf("*********************File&System&V1.0*******************************\n\n");&&
&&&&printf("命令名\t\t命令参数\t\t命令说明\n\n");&&
&&&&printf("cd\t\t目录名(路径名)\t\t切换当前目录到指定目录\n");&&
&&&&printf("mkdir\t\t目录名\t\t\t在当前目录创建新目录\n");&&
&&&&printf("rmdir\t\t目录名\t\t\t在当前目录删除指定目录\n");&&
&&&&printf("ls\t\t无\t\t\t显示当前目录下的目录和文件\n");&&
&&&&printf("create\t\t文件名\t\t\t在当前目录下创建指定文件\n");&&
&&&&printf("rm\t\t文件名\t\t\t在当前目录下删除指定文件\n");&&
&&&&printf("open\t\t文件名\t\t\t在当前目录下打开指定文件\n");&&
&&&&printf("write\t\t无\t\t\t在打开文件状态下,写该文件\n");&&
&&&&printf("read\t\t无\t\t\t在打开文件状态下,读取该文件\n");&&
&&&&printf("close\t\t无\t\t\t在打开文件状态下,读取该文件\n");&&
&&&&printf("exit\t\t无\t\t\t退出系统\n\n");&&
&&&&printf("*********************************************************************\n\n");&&
&&&&while(flag)&&
&&&&&&&&printf("%s&",&openfilelist[curdir].dir);&&
&&&&&&&&gets(s);&&
&&&&&&&&cmdn&=&-1;&&
&&&&&&&&if(strcmp(s,&""))&&
&&&&&&&&{&&
&&&&&&&&&&&&sp=strtok(s,&"&");&&
&&&&&&&&&&&&for(i&=&0;&i&&&15;&i++)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&if(strcmp(sp,&cmd[i])&==&0)&&
&&&&&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&&&&&cmdn&=&i;&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&switch(cmdn)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&case&0:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_cd(sp);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&1:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_mkdir(sp);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&case&2:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_rmdir(sp);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&3:&&
&&&&&&&&&&&&&&&&&&&&if(openfilelist[curdir].attribute&&&0x20)&&
&&&&&&&&&&&&&&&&&&&&&&&&my_ls();&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&4:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_create(sp);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&5:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_rm(sp);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&case&6:&&
&&&&&&&&&&&&&&&&&&&&sp&=&strtok(NULL,&"&");&&
&&&&&&&&&&&&&&&&&&&&if(sp&&&&(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&&&&&&&&&if(strchr(sp,&'.'))
&&&&&&&&&&&&&&&&&&&&&&&&&&&&curdir&=&my_open(sp);&&
&&&&&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&printf("the&openfile&should&have&exname.\n");&&
&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&7:&&
&&&&&&&&&&&&&&&&&&&&if(!(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&curdir&=&my_close(curdir);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("No&files&opened.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&8:&&
&&&&&&&&&&&&&&&&&&&&if(!(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_write(curdir);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("No&files&opened.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&9:&&
&&&&&&&&&&&&&&&&&&&&if(!(openfilelist[curdir].attribute&&&0x20))&&
&&&&&&&&&&&&&&&&&&&&&&&&my_read(curdir,&openfilelist[curdir].length);&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("No&files&opened.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&case&10:&&
&&&&&&&&&&&&&&&&&&&&if(openfilelist[curdir].attribute&&&0x20)&&
&&&&&&&&&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&&&&&&&&&my_exitsys();&&
&&&&&&&&&&&&&&&&&&&&&&&&flag&=&0;&&
&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&&&&&else&&
&&&&&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&default:&&
&&&&&&&&&&&&&&&&&&&&printf("Please&input&the&right&command.\n");&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&}&&
&&&&&&&&}&&
&&&&return&0;&&
阅读(...) 评论()

我要回帖

更多关于 10101010的十六 的文章

 

随机推荐