操作体统课程设计模拟二级文件管理系统c内容摘要:
cur=head。 while(curnext!=NULL) { cur=curnext。 } } memset(path,0,sizeof(path))。 strcpy(path,user[i].name)。 path[strlen(user[i].name)]=39。 /39。 cout登陆成功 endl。 sum=0。 return 1。 } else { cout密码错误。 还有 m次登陆机会 endl。 } } } } cout用户名不存在。 还有 n次登陆机会 endl。 } exit(0)。 } void initfcb() { head=new FileControlBlocks。 headfront=NULL。 headnext=NULL。 headparent=NULL。 headchild=NULL。 headfstyle=39。 \039。 memset(headfilename,0,sizeof(headfilename))。 headfilename[0]=39。 /39。 headfstyle=0。 //类型 ,文件或者文件夹 headaddr=0。 headsize=0。 //文件大小 headpriority=0。 memset(headctime,0,sizeof(headctime))。 cur=head。 } int isexist() { FileControlBlocks *p=head。 while(pnext!=NULL) { p=pnext。 //coutpfilenamenameendl。 if(strcmp(pfilename,name)==0) { return 1。 } } return 0。 } void createFile() { toAbsolutePath()。 if(isexist()) { cout文件已存在。 endl。 return。 } int size。 int addr。 cout文件大小(字节数):。 cinsize。 getchar()。 int len。 if(size%512) len=size/512+1。 else len=size/512。 cout需要的块数 lenendl。 int s=0。 for(int i=0。 i256。 i++) //分配空间 { s=0。 for(int j=0。 j+i256amp。 amp。 jlen。 j++) { if(fileBlock[i+j].used==0) //需求空间内有块已被占用 { s++。 } else { i=j+i。 break。 } } if(s==len) //成功找到足够空间时 s 的值不变 { addr=i。 for(int k=0。 ks。 k++,i++) { fileBlock[i].used=1。 } break。 } } if(slen) { cout找不到足够的存储空间。 文件创建失败。 endl。 return。 } for(int i=addr。 ilen+addr。 i++) { memset(fileBlock[i].content,0,sizeof(fileBlock[i].content))。 } FileControlBlocks *fcb=new FileControlBlocks。 strcpy(fcbfilename,name)。 fcbaddr=addr。 fcbsize=size。 fcbfstyle=0。 time_t t = time(0)。 strftime( fcbctime, sizeof(fcbctime), %Y/%m/%d,localtime(amp。 t))。 curnext=fcb。 fcbfront=cur。 fcbparent=NULL。 fcbchild=NULL。 fcbnext=NULL。 cur=fcb。 sum+=size。 if(headparent!=NULL) { headparentsize+=size。 } else { headsize+=size。 } int i=curaddr。 cout文件创建成功 ! 其块号是: iendl。 } void mkdir() { toAbsolutePath()。 if(isexist()) { cout文件或文件夹已经存在 endl。 return。 } FileControlBlocks *fcb=new FileControlBlocks。 strcpy(fcbfilename,name)。 fcbaddr=0。 fcbsize=0。 fcbfstyle=1。 time_t t = time(0)。 strftime( fcbctime, sizeof(fcbctime), %Y/%m/%d,localtime(amp。 t))。 curnext=fcb。 fcbfront=cur。 fcbparent=NULL。 fcbchild=NULL。 fcbnext=NULL。 cur=fcb。 FileControlBlocks *fcb1=new FileControlBlocks。 strcpy(fcb1filename,name)。 fcb1addr=0。 fcb1size=0。 fcb1fstyle=0。 //time_t t = time(0)。 strftime( fcb1ctime, sizeof(fcb1ctime), %Y/%m/%d,localtime(amp。 t))。 curchild=fcb1。 fcb1front=NULL。 fcb1parent=cur。 fcb1child=NULL。 fcb1next=NULL。 cout文件夹创建成功 !endl。 } void cd() { FileControlBlocks *p=head。 if(!strcmp(name,..)) { if(headparent!=NULL) { head=headparent。 cur=head。 while(headfront!=NULL) { head=headfront。 } while(curnext!=NULL) { cur=curnext。 } path[strlen(path)1]=39。 \039。 for(int i=strlen(path)1。 i) { if(path[i]==39。 /39。 ) { break。 } path[i]=39。 \039。 } return。 } else { cout已是本用户顶层目录。 endl。 return。 } } else { toAbsolutePath()。 while(pnext!=NULL) { p=pnext。 if(strcmp(pfilename,name)==0) { head=pchild。 cur=head。 strcpy(path,name)。 path[strlen(path)]=39。 /39。 while(curnext!=NULL) { cur=curnext。 } break。 } } } } void dir() { char *l[]={文件 ,目录 }。 FileControlBlocks *p=cur。 //int sum=0,used=0。 while(pfront!=NULL) p=pfront。 printf(目录名 \t 文件名 \t 文件大小 \t 类型 \t 创建时间 \n)。 while(pnext!=NULL) { p=pnext。 coutpath\t。 toRelativePath(pfilename)。 printf(%s\t%d\t\t%s\t%s\n,name,psize,l[pfstyle],pctime)。 }。操作体统课程设计模拟二级文件管理系统c
相关推荐
实现 程序使用的 变量: int choice。 //选项,用于实现主函数对不同函数的调用 int t=1。 //循环条件与退出标识 long address。 //作业区链 表地址 double length。 //作业区链表长度 int flag。 //标识作业名 ftable p = freetable。 //为 p 申请 空闲分区表 utable x = new uarea。 //为 x
询、更新等。 学生录入,教师信息的录入及数据维护。 3 系统就具备数据库维护功能,及时根据用户需求进行数据添加、删除、修改等操作。 系统开发所需技术 技术 (前身是 ASP— Active Server Pages) 技术 相对 增加了大量方便、实用的新特性 ,是一种建立在公共语言运行库上的编程框架,可用于在服务器上开发功能强大的 Web 应用程序。 它不但执行效率大幅度提高
等,其他人员年度考核定为基本称职或以下等级,本人写出书面检查并交所在单位备案。 三、附则 所有教学事故一经发现,必须及时上报教务处,相关单位不得隐瞒事实真相,否则,追究有关人员责任,视情况给予通报批评、年度考评降级等处理。 相关单位 必须及时、认真办理教务处下达的教学异常情况调查处理通知,不得拖廷时间、走过场或不实事求是地处理。 否则,追究相关人员责任,视情况给予通报批评,年度考评降级等处理。
上材料出现质量问题,我公司将会立刻更换新的材料,材料免费提供 (包料)。 ( 2)我公司承诺在贰年的质保期内,如果以上材料出现质量问题,我公司将免费派出技术人员到现场更换或维修 (包工)。 ( 3)我公司承诺在贰年的质保期内,如果以上材料出现质量问题,我公司将免费进行更换新产品后的材料安装和调试 (包安装)。 、“小包”服务 在免费维修期内的非质量问题造成的损坏
成-个优秀地项目团队。 通过对项目团队地绩效管理,来充分保证质量体 系持续有效地运行。 其次,对质量策划地工程总体质量目标,实施分解, 确定工序质量目标, 并落实到班组和个人。 有了这两条,工程施工质量就 有了基本地保障。 这里还应强调,项目部质量管理工作能够保持经常性和 系统性,领导层地重视和各职能部门地协调也是必不可少地因素。 2 .重视采购工作,保证原材料地质量。
,找出影响现场成本控制的因素是对工程进行成本控制的关键所在。 一般说来 ,主要影响施工期间建设成本的因素有以下几点 : 规章制度不健全以及管理组织不落实 ,在施工过程中对施工图纸和施工合同以及各项计划的执行情况监督检查不及时 ,造成成本失控。 如不能按照按设计施工图施工造成质量事故或返工、施工进度无故发生了误工拖延、合同执行不严格出现偏差等等都 是造成成本失控的因素。 由于没能很好的控制设计变更